-
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_resolve: don't deny outer type parameters in embedded constants. #41939
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
eddyb
force-pushed
the
trait-assoc-const-default
branch
from
May 12, 2017 13:42
a3f677f
to
3e32769
Compare
shepmaster
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
May 12, 2017
The resolve part looks good. |
📌 Commit 3e32769 has been approved by |
eddyb
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
May 13, 2017
☔ The latest upstream changes (presumably #41965) made this pull request unmergeable. Please resolve the merge conflicts. |
eddyb
force-pushed
the
trait-assoc-const-default
branch
from
May 13, 2017 14:46
3e32769
to
dc7ffbe
Compare
@bors r=petrochenkov |
📌 Commit dc7ffbe has been approved by |
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this pull request
May 13, 2017
…petrochenkov rustc_resolve: don't deny outer type parameters in embedded constants. This solves a problem noted at rust-lang#29646 (comment), where an associated const default in a trait couldn't refer to `Self` or type parameters, due to inaccuracies in lexical scoping. I've also allowed "embedded expressions" (`[T; expr]`, `[x; expr]`, `typeof expr`) to refer to type parameters in scope. *However*, the typesystem still doesn't handle rust-lang#34344. Fully resolving that issue requires breaking cycles more aggressively (e.g. lazy evaluation), *even* in when the expression doesn't depend on type parameters, to type-check it at all, and then also type-level "constant projections" (in the vein of `{expr}` from const generics).
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this pull request
May 14, 2017
…petrochenkov rustc_resolve: don't deny outer type parameters in embedded constants. This solves a problem noted at rust-lang#29646 (comment), where an associated const default in a trait couldn't refer to `Self` or type parameters, due to inaccuracies in lexical scoping. I've also allowed "embedded expressions" (`[T; expr]`, `[x; expr]`, `typeof expr`) to refer to type parameters in scope. *However*, the typesystem still doesn't handle rust-lang#34344. Fully resolving that issue requires breaking cycles more aggressively (e.g. lazy evaluation), *even* in when the expression doesn't depend on type parameters, to type-check it at all, and then also type-level "constant projections" (in the vein of `{expr}` from const generics).
bors
added a commit
that referenced
this pull request
May 14, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solves a problem noted at #29646 (comment), where an associated const default in a trait couldn't refer to
Self
or type parameters, due to inaccuracies in lexical scoping.I've also allowed "embedded expressions" (
[T; expr]
,[x; expr]
,typeof expr
) to refer to type parameters in scope. However, the typesystem still doesn't handle #34344.Fully resolving that issue requires breaking cycles more aggressively (e.g. lazy evaluation), even in when the expression doesn't depend on type parameters, to type-check it at all, and then also type-level "constant projections" (in the vein of
{expr}
from const generics).