-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
iat selection: normalize self ty & completely erase bound vars #112493
iat selection: normalize self ty & completely erase bound vars #112493
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
65d6bc6
to
76558b7
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.
r=me with nits
match ct.kind() { | ||
ty::ConstKind::Bound(_, bv) => self.tcx.mk_const( | ||
ty::PlaceholderConst { universe: self.universe, bound: bv }, | ||
ct.ty(), |
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 assert somewhere that the ct ty has no escaping bound vars?
@@ -2465,30 +2467,60 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |||
|
|||
let mut fulfillment_errors = Vec::new(); |
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.
also kinda unrelated but do you mind, at the top of lookup_inherent_assoc_ty
, asserting that tcx.features().inherent_associated_types
or whatever, just so we make sure to never enter this code unless that feature is active? 😅
} | ||
|
||
// FIXME(non_lifetime_binders): Here we are "truncating" or "flattening" the | ||
// universe of placeholders. Is that correct during selection? |
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's probably fine here (for now)
76558b7
to
a995255
Compare
@@ -2442,6 +2444,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |||
return Ok(None); | |||
} | |||
|
|||
if !tcx.features().inherent_associated_types { | |||
tcx.sess | |||
.delay_span_bug(span, "found inherent assoc type without the feature being gated"); |
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.
Not using assert!
or similar as we'd ice when sb. defined & used an IAT w/o enabling the feature.
Instead of delay_span_bug
, I could exit early at the very start of the function but that would lead to "spurious" extra errors on IAT use-sites (ambiguous assoc ty) next to the feature gate error.
@bors r+ rollup (feature gated) |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#112475 (Fix issue for module name when surround the struct literal with parentheses) - rust-lang#112477 (Give more helpful progress messages in `Assemble`) - rust-lang#112484 (Fix ntdll linkage issues on Windows UWP platforms) - rust-lang#112492 (Migrate GUI colors test to original CSS color format) - rust-lang#112493 (iat selection: normalize self ty & completely erase bound vars) - rust-lang#112497 (abs_sub: fix typo 0[-:][+.]0) - rust-lang#112498 (Update links to Rust Reference in diagnostic) r? `@ghost` `@rustbot` modify labels: rollup
Erase bound vars (most notably late-bound regions) irrespective of their binding level instead of just at the innermost one.
Fixes #111404.