-
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
Merge Promoted
and Static
in mir::Place
#59232
Conversation
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
r? @oli-obk |
Promoted
and Static
in mir::Place
4a149ed
to
268b4f7
Compare
note that you need to rebase over the master branch, since there are merge conflicts |
Not sure how to get the |
You can add a new |
I am stuck with figuring out how to obtain the current function's |
4d7d305
to
d9092a7
Compare
d9092a7
to
752544b
Compare
The job 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 |
Fixed everything. |
@bors r+ Thanks! |
📌 Commit fb93f10 has been approved by |
…oli-obk Merge `Promoted` and `Static` in `mir::Place` fixes rust-lang#53848
…oli-obk Merge `Promoted` and `Static` in `mir::Place` fixes rust-lang#53848
…oli-obk Merge `Promoted` and `Static` in `mir::Place` fixes rust-lang#53848
assert!(!static_.ty.needs_subst()); | ||
let layout = self.layout_of(static_.ty)?; | ||
let instance = ty::Instance::mono(*self.tcx, static_.def_id); | ||
Base(PlaceBase::Static(box Static { kind: StaticKind::Static(def_id), ty })) => { |
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.
Why do these cases need to be handled so differently here? I somewhat hoped they'd get more uniform though this PR.
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.
To get this resolved we'll need to either teach intern_static
about promoteds (which opens up a whole can of worms since we'd need to put a GlobalId
in there (which has 'tcx
lifetimes) or we'd need to still treat it differently in the end, which would end up with the code we have now.
Rollup of 10 pull requests Successful merges: - #59150 (Expand suggestions for type ascription parse errors) - #59232 (Merge `Promoted` and `Static` in `mir::Place`) - #59267 (Provide suggestion when using field access instead of path) - #59315 (Add no_hash to query macro and move some queries over) - #59334 (Update build instructions in README.md) - #59362 (Demo `FromIterator` short-circuiting) - #59374 (Simplify checked_duration_since) - #59389 (replace redundant note in deprecation warning) - #59410 (Clarify `{Ord,f32,f64}::clamp` docs a little) - #59419 (Utilize `?` instead of `return None`.) Failed merges: r? @ghost
Rollup of 10 pull requests Successful merges: - #59150 (Expand suggestions for type ascription parse errors) - #59232 (Merge `Promoted` and `Static` in `mir::Place`) - #59267 (Provide suggestion when using field access instead of path) - #59315 (Add no_hash to query macro and move some queries over) - #59334 (Update build instructions in README.md) - #59362 (Demo `FromIterator` short-circuiting) - #59374 (Simplify checked_duration_since) - #59389 (replace redundant note in deprecation warning) - #59410 (Clarify `{Ord,f32,f64}::clamp` docs a little) - #59419 (Utilize `?` instead of `return None`.) Failed merges: r? @ghost
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)] | ||
pub struct Static<'tcx> { | ||
pub def_id: DefId, | ||
pub ty: Ty<'tcx>, |
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.
cc @arielb1 @nikomatsakis Are pre-normalized types in MIR still needed?
fixes #53848