Promoteds are statics and statics have a place, not just a value#52597
Promoteds are statics and statics have a place, not just a value#52597bors merged 7 commits intorust-lang:masterfrom
Conversation
|
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 |
There was a problem hiding this comment.
SIMD shuffle indices are an array, which usually is specified inline, and not via an explicit constant. so the array is promoted and we need to read it here
There was a problem hiding this comment.
I see. A comment to that effect would be great.
src/librustc_mir/borrow_check/mod.rs
Outdated
There was a problem hiding this comment.
This should probably be a bug!()? I can’t think of any case where you’d genuinely want to report an error to the user if you somehow end up with a &mut promoted at this point in code.
There was a problem hiding this comment.
Shouldn’t this also return an EqualOrDisjoint if the two promoteds are the same?
|
This is r=me once #52571 lands and the issues are fixed. |
|
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 |
c0ab624 to
d4ab267
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 |
|
☔ The latest upstream changes (presumably #52571) made this pull request unmergeable. Please resolve the merge conflicts. |
d3f05e5 to
cbd4274
Compare
| "could not evaluate constant operand", | ||
| ); | ||
| // Allow RalfJ to sleep soundly knowing that even refactorings that remove | ||
| // the above error (or silence it under some conditions) will not cause UB |
|
@bors r=nagisa |
|
📌 Commit cbd4274 has been approved by |
Promoteds are statics and statics have a place, not just a value r? @eddyb This makes everything around promoteds a little simpler
|
☀️ Test successful - status-appveyor, status-travis |
Tested on commit rust-lang/rust@6a3db03. Direct link to PR: <rust-lang/rust#52597> 💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
|
| // and we can then extract the value by evaluating the promoted. | ||
| mir::Operand::Copy(mir::Place::Promoted(box(index, ty))) | | ||
| mir::Operand::Move(mir::Place::Promoted(box(index, ty))) => { | ||
| let param_env = ty::ParamEnv::reveal_all(); |
There was a problem hiding this comment.
This should probably be something like self.param_env (minor future hazard if we start deduplicating instances).
There was a problem hiding this comment.
The PR already landed.Does anyone take care of fixing this?^^
There was a problem hiding this comment.
This is rustc_codegen_llvm... we don't have a param env, everything is monomorphized
| let type_checker = &mut self.cx; | ||
|
|
||
| // FIXME -- For now, use the substitutions from | ||
| // `value.ty` rather than `value.val`. The |
There was a problem hiding this comment.
Heh, value.val mention here is outdated (cc @nikomatsakis).
r? @eddyb
This makes everything around promoteds a little simpler