-
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
Simplify the tcx.alloc_map
API
#71508
Conversation
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
321a378
to
c12029c
Compare
Some(GlobalAlloc::Static(def_id)) => Some(def_id), | ||
Some(_) => None, | ||
None => { | ||
tcx.sess.delay_span_bug(DUMMY_SP, "MIR cannot contain dangling const pointers"); |
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.
This turns a delay_bug into a bug!
-- let's see if we can get away with that. ;)
GlobalAlloc::Function(instance) => instance, | ||
_ => bug!("expected function, got {:?}", self), | ||
} | ||
} |
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.
For symmetry, should we have unwrap_static
?
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 considered it, but found no possible use sites, thus left it out.
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.
Fair enough.
@bors r+ |
📌 Commit b07a44d has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#69406 (upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir) - rust-lang#71185 (Move tests from `test/run-fail` to UI) - rust-lang#71234 (rustllvm: Use .init_array rather than .ctors) - rust-lang#71508 (Simplify the `tcx.alloc_map` API) - rust-lang#71555 (Remove ast::{Ident, Name} reexports.) Failed merges: r? @ghost
Update to rustc changes changes needed once rust-lang/rust#71508 gets merged
This PR changes all functions that require manually locking the
alloc_map
to functions onTyCtxt
that lock the map internally. In the same step we make theTyCtxt::alloc_map
field private.r? @RalfJung