diff options
| author | bors <bors@rust-lang.org> | 2025-05-16 02:34:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-16 02:34:32 +0000 |
| commit | 7e19eef048ba58c28c70afbf5f95da4829c15796 (patch) | |
| tree | 73037a0ea9f5cc6608d4e293a5a175bf70b231c9 /library/core/src/str/mod.rs | |
| parent | 6d1875f99b2d5c1499410505f4233fbf8dbdc23b (diff) | |
| parent | df479588945119d2e356fdfef21a5d2094ce9499 (diff) | |
| download | rust-7e19eef048ba58c28c70afbf5f95da4829c15796.tar.gz rust-7e19eef048ba58c28c70afbf5f95da4829c15796.zip | |
Auto merge of #140557 - compiler-errors:remove-wf-hack, r=lcnr
Remove manual WF hack
We do not need this hack anymore since we fixed the candidate selection problems with `Sized` bounds. We prefer built-in sized bounds now since #138176, which fixes the only regression this hack was intended to fix.
While this theoretically is broken for some code, for example, when there a param-env bound that shadows an impl or built-in trait, we don't see it in practice and IMO it's not worth the burden of having to maintain this wart in `compare_method_predicate_entailment`.
The code that regresses is, for example:
```rust
trait Bar<'a> {}
trait Foo<'a, T> {
fn method(&self)
where
Self: Bar<'a>;
}
struct W<'a, T>(&'a T)
where
Self: Bar<'a>;
impl<'a, 'b, T> Bar<'a> for W<'b, T> {}
impl<'a, 'b, T> Foo<'a, T> for W<'b, T> {
fn method(&self) {}
}
```
Specifically, I don't believe this is really going to be encountered in practice. For this to fail, there must be a where clause in the *trait method* that would shadow an impl or built-in (non-`Sized`) candidate in the trait, and this shadowing would need to be encountered when solving a nested WF goal from the impl self type.
See #108544 for the original regression. Crater run is clean!
r? lcnr
Diffstat (limited to 'library/core/src/str/mod.rs')
0 files changed, 0 insertions, 0 deletions
