-
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
rustc_mir: allow promotion of promotable temps indexed at runtime. #50603
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 |
☔ The latest upstream changes (presumably #50249) made this pull request unmergeable. Please resolve the merge conflicts. |
// `forbidden_mut` is false, so we can safely ignore | ||
// `MUTABLE_INTERIOR` from the local's qualifications. | ||
// This allows borrowing fields which don't have | ||
// `MUTABLE_INTERIOR`, from a type that does. |
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.
It'd be nice to have an example of some Rust code where this applies, for those of us whose brains are tired
if self.mode != Mode::Fn { | ||
span_err!(self.tcx.sess, self.span, E0492, | ||
"cannot borrow a constant which may contain \ | ||
interior mutability, create a static instead"); | ||
} | ||
} else { | ||
forbidden_mut = 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.
Can you put a comment here? What does this else
indicate? I can't see it in the diff, it'll also be hard to tell when reading. Something like:
// Not a mut borrow
(Is that right? I'm guessing)
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.
Hmm maybe I should split this part into its own commit, it's a straight-forward translation of the old code, but it's mixed in with new parts.
@bors r+ |
📌 Commit d1f117d has been approved by |
rustc_mir: allow promotion of promotable temps indexed at runtime. Fixes #49955. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
Fixes #49955.
r? @nikomatsakis