-
Notifications
You must be signed in to change notification settings - Fork 476
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
const_eval: update for const_mut_refs and const_refs_to_cell stabilization #1590
Conversation
src/const_eval.md
Outdated
* All forms of [borrow]s, including raw borrows, with one limitation: | ||
mutable borrows and shared borrows to values with interior mutability | ||
are only allowed to refer to *transient* places. A place is *transient* | ||
if it will be deallocated before the end of evaluating the current constant item. |
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.
Given that not all const contexts are syntactically items, though they are desugared that way, would it be better here to say "end of evaluating the current constant context"?
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.
If "evaluating a const context" is meaningful, then yeah that would work. It sounds a bit odd to me, how can you evaluate a "context"? The context is what the evaluation occurs in.
No strong preference either way.
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.
Maybe "evaluating the contents of the current const context"? Open to other ideas.
The main thrust is that const context is something we define and seems to be closer to what we mean here.
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.
"evaluating the item" is how we call it in the compiler so I got used to that one. ;)
aa1dab6
to
ace105a
Compare
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.
Thanks!
This is the reference PR accompanying rust-lang/rust#129195.
Fixes rust-lang/rust#57349
Fixes rust-lang/rust#80384