-
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: treat const bodies like fn bodies in middle::region. #41515
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
|
I don't really understand what the point of checking substitutions is, can someone explain that? |
The idea is that computing We still want regionck to be smarter, tho (because of calls and the like). |
080afa9
to
d33069b
Compare
d33069b
to
92d7bbc
Compare
You need to fix "droplessness" - have
|
@arielb1 Yeah, I was telling @nikomatsakis that I have no clue how I would do this. |
So I've got a rather meandering PR (that is now working, though) that refactors the region-maps stuff somewhat. (It converts them into queries keyed by the enclosing item-like, in particular.) It doesn't directly bear on this, I guess, though it certainly...interacts. It doesn't seem too hard to have the idea of a "static temporary scope", though. Right now we have this "terminating scopes" set, I guess one way would be to make that into a map where the value is a One of the things I've been wondering about here: For constant expressions like |
@nikomatsakis Yeah I was wondering if I should have a |
@eddyb i.e., specifically in this case? You'll have to make sure that there is no parent scope, as well, since otherwise we'll walk right into the enclosing function as we traverse the scope tree. But given that these are forced to be a 'constant context' that seems correct anyhow. |
@eddyb - are you still working on this? |
Yeah, I'm waiting for #41662 to land first. |
☔ The latest upstream changes (presumably #41702) made this pull request unmergeable. Please resolve the merge conflicts. |
92d7bbc
to
90af729
Compare
Okay, turns out I was close, but @nikomatsakis had to remind me that I had to update |
@bors r+ |
📌 Commit 90af729 has been approved by |
⌛ Testing commit 90af729 with merge f1140a3... |
rustc: treat const bodies like fn bodies in middle::region. Allows `T::ASSOC_CONST` to be used without a `T: 'static` bound. cc @rust-lang/compiler @rust-lang/lang
☀️ Test successful - status-appveyor, status-travis |
Allows
T::ASSOC_CONST
to be used without aT: 'static
bound.cc @rust-lang/compiler @rust-lang/lang