-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove librustc_ast
session globals
#74932
Conversation
e2cb235
to
6b3064f
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 6b3064f7315c9619debcf87aa76cdb1eeb78f237 with merge 3989933cd82bfcf4dd92536dcd76dc61254f4a8d... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 3989933cd82bfcf4dd92536dcd76dc61254f4a8d with parent 6e50a22, future comparison URL. |
Finished benchmarking try commit (3989933cd82bfcf4dd92536dcd76dc61254f4a8d): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
This is a slight (up to 0.4%) slowdown. |
I suspect that majority of these |
Blocked on #74952. |
I was wondering about that, but I had no sense of which were necessary and which weren't, so I kept them all except for the couple that I couldn't keep. It'd be great if there was a clear rule about when |
I started working on this and will make a PR tomorrow, most likely. UPD: #74952 is the preliminary implementation. |
rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc, only rustc needs to mark attributes as used. cc rust-lang#74932 r? @nnethercote
rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc, only rustc needs to mark attributes as used. cc rust-lang#74932 r? @nnethercote
#75043 has landed. |
6b3064f
to
6d83ba1
Compare
I have updated. Most of the changes outside of rustc are now no longer necessary, but the changes within rustc are still there. So it's still a big change. |
It's a weird rustdoc failure I haven't seen before, only on one of the linux platforms:
This is while running rustdoc on the I'm not sure what to do here, whether it's spurious and likely to disappear if we try again, or if it's likely to recur. If it's the latter, I guess I should add the @jyn514, any ideas? |
I wouldn't expect it to be random. I'm not sure how it's related to your change, but it doesn't seem to be an infinite loop so I would try raising the type limit like it suggests. |
These arguments are never `None`.
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
To avoid rustdoc problems.
ccab50d
to
96dd044
Compare
I added the 256 recursion limit. @bors r=petrochenkov |
📌 Commit 96dd044 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Tested on commit rust-lang/rust@e61621c. Direct link to PR: <rust-lang/rust#74932> 💔 miri on windows: test-fail → build-fail (cc @oli-obk @eddyb @RalfJung). 💔 miri on linux: test-fail → build-fail (cc @oli-obk @eddyb @RalfJung).
do not call black_box on Miri Helps with rust-lang#75274 (but rust-lang#74932 introduced unrelated breakage that will need a separate fix) Cc @eggyal r? @Mark-Simulacrum
rustup Adjust for rust-lang/rust#74932. Blocked on rust-lang/rust#75282.
rustup Adjust for rust-lang/rust#74932. Blocked on rust-lang/rust#75282.
By moving the data onto
Session
.r? @petrochenkov