-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
unwrap_usize
should at least try to evaluate the underlying constant
#59369
Conversation
cc @nikomatsakis this is related to lazy normalization. I could probably run the regular opportunistic normalization on the types (and thus the array lengths inside the array types) obtained in rust/src/librustc_typeck/check/_match.rs Line 396 in ad8a3eb
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@eddyb is 1650513 what you had in mind? |
Your error says this is what can't be lifted: ParamEnvAnd {
param_env: ParamEnv {
caller_bounds: [
Binder(
OutlivesPredicate(
'_#0r,
'_#1r
)
)
],
reveal: UserFacing,
def_id: None
},
value: usize
} But this can't really exist? Ohhh, you need to convert it to a |
☔ The latest upstream changes (presumably #59636) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #59612) made this pull request unmergeable. Please resolve the merge conflicts. |
ping from triage @eddyb waiting for your review on this |
Nope, I still have things to address, sorry about that |
This is also waiting on @nikomatsakis for a few questions. |
cc #60471 since this is "related to lazy normalization" |
@nikomatsakis this is ready for review again. The big question related to lazy normalization is whether it's ok that this evalutes (some) constants at the point where someone is trying to act upon the actual value of the constant. Eager normalization happens in rust/src/librustc/traits/project.rs Line 401 in 999c1fc
rust/src/librustc/traits/query/normalize.rs Line 191 in 5cd2806
EDIT for clarity: this PR does not change eager normalization. We just do lazy normalization of some constants that were never eagerly normalized. |
@oli-obk I would expect that for now eager normalization would still resolve at least everything which evaluates successfully, right? |
☔ The latest upstream changes (presumably #59276) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=eddyb,nikomatsakis |
📌 Commit bd57498 has been approved by |
☀️ Test successful - checks-azure |
Rustup rust-lang/rust#59369 Unblock rust-lang/rust#63280 changelog: none
r? @eddyb
fixes #59016
I know that I'm still using
ParamEnv
wrongly, but that's a preexisting issue not amplified by this PR.