about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-10 17:54:28 +0200
committerGitHub <noreply@github.com>2024-07-10 17:54:28 +0200
commit7faef5d5edba59e3c236ff3b6e413659256f2c97 (patch)
treee41bed5304ac2e9737f70aaca2fcbecc47161509 /compiler/rustc_pattern_analysis/src
parentbbb0f66a0f032de564d4a6cd052597f340ef68ae (diff)
parentf77394fdf3f45188d3f110f72f31c4233d4d38eb (diff)
downloadrust-7faef5d5edba59e3c236ff3b6e413659256f2c97.tar.gz
rust-7faef5d5edba59e3c236ff3b6e413659256f2c97.zip
Rollup merge of #127568 - lcnr:undo-leakcheck, r=oli-obk
instantiate higher ranked goals in candidate selection again

This reverts #119820 as that PR has a significant impact and breaks code which *feels like it should work*. The impact ended up being larger than we expected during the FCP and we've ended up with some ideas for how we can work around this issue in the next solver. This has been discussed in the previous high bandwidth t-types meeting: https://rust-lang.zulipchat.com/#narrow/stream/326132-t-types.2Fmeetings/topic/2024-07-09.20high.20bandwidth.20meeting.

We'll therefore keep this inconsistency between the two solvers for now and will have to deal with it before stabilizating the use of the new solver outside of coherence: https://github.com/rust-lang/trait-system-refactor-initiative/issues/120.

fixes #125194 after a beta-backport.

The pattern which is more widely used than expected and feels like it should work, especially without deep knowledge of the type system is
```rust
trait Trait<'a> {}
impl<'a, T> Trait<'a> for T {}

fn trait_bound<T: for<'a> Trait<'a>>() {}

// A function with a where-bound which is more restrictive than the impl.
fn function1<T: Trait<'static>>() {
    // stable: ok
    // with #119820: error as we prefer the where-bound over the impl
    // with this PR: back to ok
    trait_bound::<T>();
}

```

r? `@rust-lang/types`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions