forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only make GAT ambiguous in match_projection_projections considering s…
…hallow resolvability
- Loading branch information
1 parent
ddba1dc
commit fa829fe
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/ui/generic-associated-types/guide-inference-in-gat-arg-deeper.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Fix for <https://github.com/rust-lang/rust/issues/125196>. | ||
//@ check-pass | ||
|
||
trait Tr { | ||
type Gat<T>; | ||
} | ||
|
||
struct W<T>(T); | ||
|
||
fn foo<T: Tr>() where for<'a> &'a T: Tr<Gat<W<i32>> = i32> { | ||
let x: <&T as Tr>::Gat<W<_>> = 1i32; | ||
// Previously, `match_projection_projections` only checked that | ||
// `shallow_resolve(W<?0>) = W<?0>`. This won't prevent *all* inference guidance | ||
// from projection predicates in the environment, just ones that guide the | ||
// outermost type of each GAT constructor. This is definitely wrong, but there is | ||
// code that relies on it in the wild :/ | ||
} | ||
|
||
fn main() {} |