-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve ICE message for forbidden dep-graph reads. #124252
Improve ICE message for forbidden dep-graph reads. #124252
Conversation
|
||
panic!( | ||
"Error: trying to record dependency on DepNode {dep_node} in a \ | ||
context that does not allow it (e.g. during query deserialization)." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, as someone who knows nothing about the query/incremental system, I still don't know that "record dependency" is the same as "invoke query". Or maybe it's not the same, but the explanation you gave me that I actually understood was "you invoked a query in a context that does not allow it". But maybe there are cases where saying "invoked a query" here would be wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Invoking a query is only of several ways of recording something in the dependency graph, but it is by far the most common. I'll update the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the new message better?
The most common case of recording a dependency on a DepNode `foo` is \ | ||
when the correspondng query `foo` is invoked. Invoking queries is not \ | ||
allowed as part of loading something from the incremental on-disk cache. \ | ||
See <https://github.com/rust-lang/rust/pull/91919>." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot better, thanks!
Not sure if linking to the PR is very useful, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the link in unless you or @oli-obk think that it's actively hurting understandability.
…read-ice, r=oli-obk Improve ICE message for forbidden dep-graph reads. The new message mentions the main context that the ICE might occur in and it mentions the query/dep-node that is being read. cc rust-lang#123781, where this would have been helpful.
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - rust-lang#124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - rust-lang#124217 (coverage: Prepare for improved branch coverage) - rust-lang#124220 (Miri: detect wrong vtables in wide pointers) - rust-lang#124252 (Improve ICE message for forbidden dep-graph reads.) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#115913 (checked_ilog: improve performance) - rust-lang#124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - rust-lang#124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - rust-lang#124217 (coverage: Prepare for improved branch coverage) - rust-lang#124230 (Stabilize generic `NonZero`.) - rust-lang#124252 (Improve ICE message for forbidden dep-graph reads.) - rust-lang#124268 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#115913 (checked_ilog: improve performance) - rust-lang#124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - rust-lang#124183 (Stop taking `ParamTy`/`ParamConst`/`EarlyParamRegion`/`AliasTy` by ref) - rust-lang#124217 (coverage: Prepare for improved branch coverage) - rust-lang#124230 (Stabilize generic `NonZero`.) - rust-lang#124252 (Improve ICE message for forbidden dep-graph reads.) - rust-lang#124268 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124252 - michaelwoerister:better-forbidden-read-ice, r=oli-obk Improve ICE message for forbidden dep-graph reads. The new message mentions the main context that the ICE might occur in and it mentions the query/dep-node that is being read. cc rust-lang#123781, where this would have been helpful.
The new message mentions the main context that the ICE might occur in and it mentions the query/dep-node that is being read.
cc #123781, where this would have been helpful.