-
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
NLL: cast causes failure to promote to static #55385
Conversation
8259fd0
to
1680829
Compare
PlaceContext::NonUse(NonUseContext::StorageDead) | | ||
PlaceContext::NonUse(NonUseContext::AscribeUserTy) | | ||
PlaceContext::NonUse(NonUseContext::Validate) => false, | ||
} |
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.
What is this used for? It's a new classification, isn't it?
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 moved this function from another pass that I stumbled upon while making changes, it was used in a handful of places and was being imported from that pass.
src/librustc/mir/visit.rs
Outdated
pub enum PlaceContext<'tcx> { | ||
NonMutatingUse(NonMutatingUseContext), | ||
MutatingUse(MutatingUseContext), | ||
MaybeMutatingUse(MaybeMutatingUseContext<'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.
This is not nice... now we have a mixture of type-based classification and dynamic classification, not getting the benefits of either of them.
Given this, I don't think it makes any sense to separate the enum into 4.
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've modified this to remove the fourth variant. It's still not ideal, because there are now three borrow variants, but I think it is cleaner than with four variants.
This comment has been minimized.
This comment has been minimized.
1680829
to
dcaf3fd
Compare
@bors r+ 🏎️ |
📌 Commit dcaf3fd2f7b45ca4cf80aaa3be312b6b886e9c33 has been approved by |
@bors p=1 This is an RC2 "nice to have" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dcaf3fd
to
6b33189
Compare
@bors r=oli-obk |
📌 Commit 6b33189b7f7d07544563b92a55edce0240327fa4 has been approved by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This commit adds logging statements to `promote_consts` and `qualify_consts` to make it easier to understand what it is doing.
@bors r=oli-obk |
📌 Commit 6208bd8 has been approved by |
@bors p=1 As mentioned above, this is nice to have for RC2, so we are trying to win the race to get it in before beta cutoff |
⌛ Testing commit 6208bd8 with merge a47da3a38c1ffaa0805525fc5e1a0a92b4216303... |
This comment has been minimized.
This comment has been minimized.
@bors retry |
@bors retry |
NLL: cast causes failure to promote to static Fixes #55288. See commit messages for more details. r? @oli-obk cc @nikomatsakis cc @pnkfelix cc @RalfJung
☀️ Test successful - status-appveyor, status-travis |
Nominating for beta backport, since this fixes a beta regression.
cc @rust-lang/compiler |
beta backport rollup Backports of some beta-approved PRs - [x] #55385: NLL: cast causes failure to promote to static - [x] #56043: remove "approx env bounds" if we already know from trait - [x] #56003: do not propagate inferred bounds on trait objects if they involve `Self` - [x] #55852: Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint - [x] #55804: rustdoc: don't inline `pub use some_crate` unless directly asked to - [x] #56059: Increase `Duration` approximate equal threshold to 1us - [x] Keep resolved defs in path prefixes and emit them in save-analysis #54145 - [x] Adjust Ids of path segments in visibility modifiers #55487 - [x] save-analysis: bug fix and optimisation. #55521 - [x] save-analysis: be even more aggressive about ignorning macro-generated defs #55936 - [x] save-analysis: fallback to using path id #56060 - [x] save-analysis: Don't panic for macro-generated use globs #55879 - [x] Add temporary renames to manifests for rustfmt/clippy #56081 - [x] Revert #51601 #56049 - [x] Fix stability hole with `static _` #55983 - [x] #56077 - [x] Fix Rustdoc ICE when checking blanket impls #55258 - [x] Updated RELEASES.md for 1.31.0 #55678 - [x] ~~#56061~~ #56111 - [x] Stabilize `extern_crate_item_prelude` #56032 Still running tests locally, and I plan to backport @nrc's other PRs too (cc @petrochenkov -- thanks for the advice)
Fixes #55288. See commit messages for more details.
r? @oli-obk
cc @nikomatsakis
cc @pnkfelix
cc @RalfJung