-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Use region-erased self type during IAT selection #109423
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use region-erased self type during IAT selection #109423
Conversation
@@ -2224,6 +2224,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |||
} | |||
}; | |||
|
|||
// Regions are not considered during selection. | |||
let erased_self_ty = tcx.fold_regions(self_ty, |_, _| tcx.lifetimes.re_erased); |
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.
I'm going back and forth whether we should use replace_escaping_bound_vars_uncached
here instead...
If you don't want to use that, can you at least leave a FIXME saying that this only needs to deal w escaping bound vars (and not, e.g., early-bound regions), and it currently doesn't handle ty/const late-bound vars correctly?
r=me with nits dealt with either way, @bors delegate+ |
✌️ @fmease can now approve this pull request |
9d666eb
to
293f21c
Compare
@bors r=compiler-errors |
…-in-self-ty, r=compiler-errors Use region-erased self type during IAT selection Split off from rust-lang#109410 as discussed. Fixes rust-lang#109299. Re UI test: I use a reproducer of rust-lang#109299 that contains a name resolution error instead of reproducer [`regionck-2.rs`](https://github.com/rust-lang/rust/blob/fc7ed4af165c27ab5914b93251194f826920cc65/tests/ui/associated-inherent-types/regionck-2.rs) (as found in the `AliasKind::Inherent` PR) since it would (incorrectly) pass typeck in this PR due to the lack of regionck and I'd rather not make *that* a regression test (with or without `known-bug`). `@rustbot` label F-inherent_associated_types r? `@compiler-errors`
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#108954 (rustdoc: handle generics better when matching notable traits) - rust-lang#109203 (refactor/feat: refactor identifier parsing a bit) - rust-lang#109213 (Eagerly intern and check CrateNum/StableCrateId collisions) - rust-lang#109358 (rustc: Remove unused `Session` argument from some attribute functions) - rust-lang#109359 (Update stdarch) - rust-lang#109378 (Remove Ty::is_region_ptr) - rust-lang#109423 (Use region-erased self type during IAT selection) - rust-lang#109447 (new solver cleanup + implement coherence) - rust-lang#109501 (make link clickable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Split off from #109410 as discussed.
Fixes #109299.
Re UI test: I use a reproducer of #109299 that contains a name resolution error instead of reproducer
regionck-2.rs
(as found in theAliasKind::Inherent
PR) since it would (incorrectly) pass compilation in this PR due to the lack of regionck and I'd rather not make that a regression test (with or withoutknown-bug
).@rustbot label F-inherent_associated_types
r? @compiler-errors