-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Some more refactorings towards removing driver queries #132410
base: master
Are you sure you want to change the base?
Conversation
The Miri subtree was changed cc @rust-lang/miri |
Probably compat relnotes for custom drivers? |
b17abaa
to
aaf0567
Compare
Custom drivers are unstable and by the time we get release notes all custom drivers that are still maintained will have updated already for at least a month. If you are writing a custom driver you have to be looking for PR's when something breaks anyway. |
This comment has been minimized.
This comment has been minimized.
aaf0567
to
86b0254
Compare
This comment has been minimized.
This comment has been minimized.
86b0254
to
c2423f3
Compare
This comment has been minimized.
This comment has been minimized.
c2423f3
to
7e7a344
Compare
This comment has been minimized.
This comment has been minimized.
7e7a344
to
a30d62f
Compare
This comment has been minimized.
This comment has been minimized.
5bc8708
to
dd67650
Compare
This allows simplifying the call site and make_input by using a single match instead of two levels of if's.
This allows re-entrant entering of the GlobalCtxt
We now only exit the GlobalCtxt when calling a callback and all the way at the end when the GlobalCtxt is about to be destroyed.
dd67650
to
74fdbb7
Compare
This comment has been minimized.
This comment has been minimized.
There is no other query that may need to be called at that point anyway.
Several custom drivers are incorrectly calling queries.global_ctxt() from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an &rustc_ast::Crate instead.
74fdbb7
to
159ba4c
Compare
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.
Just a nit and r=me
@bors r=cjgillot |
…_round, r=cjgillot Some more refactorings towards removing driver queries Follow up to rust-lang#127184 ## Custom driver breaking change The `after_analysis` callback is changed to accept `TyCtxt` instead of `Queries`. The only safe query in `Queries` to call at this point is `global_ctxt()` which allows you to enter the `TyCtxt` either way. To fix your custom driver, replace the `queries: &'tcx Queries<'tcx>` argument with `tcx: TyCtxt<'tcx>` and remove your `queries.global_ctxt().unwrap().enter(|tcx| { ... })` call and only keep the contents of the closure. ## Custom driver deprecation The `after_crate_root_parsing` callback is now deprecated. Several custom drivers are incorrectly calling `queries.global_ctxt()` from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an `&rustc_ast::Crate` instead.
Follow up to #127184
Custom driver breaking change
The
after_analysis
callback is changed to acceptTyCtxt
instead ofQueries
. The only safe query inQueries
to call at this point isglobal_ctxt()
which allows you to enter theTyCtxt
either way. To fix your custom driver, replace thequeries: &'tcx Queries<'tcx>
argument withtcx: TyCtxt<'tcx>
and remove yourqueries.global_ctxt().unwrap().enter(|tcx| { ... })
call and only keep the contents of the closure.Custom driver deprecation
The
after_crate_root_parsing
callback is now deprecated. Several custom drivers are incorrectly callingqueries.global_ctxt()
from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an&rustc_ast::Crate
instead.