-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make infer higher ranked equate use bidirectional subtyping in invari…
…ant context
- Loading branch information
1 parent
384d26f
commit 23ae3db
Showing
15 changed files
with
153 additions
and
47 deletions.
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
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
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
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
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
10 changes: 6 additions & 4 deletions
10
tests/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))` | ||
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1 | ||
warning: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))` | ||
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:22:1 | ||
| | ||
LL | impl Trait for for<'r> fn(fn(&'r ())) {} | ||
| ------------------------------------- first implementation here | ||
LL | impl<'a> Trait for fn(fn(&'a ())) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'r> fn(fn(&'r ()))` | ||
| | ||
= warning: the behavior may change in a future release | ||
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> | ||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details | ||
= note: `#[warn(coherence_leak_check)]` on by default | ||
|
||
error: aborting due to 1 previous error | ||
warning: 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
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
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
error[E0119]: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a u32, &'b u32)` | ||
--> $DIR/coherence-fn-inputs.rs:15:1 | ||
warning: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a u32, &'b u32)` | ||
--> $DIR/coherence-fn-inputs.rs:16:1 | ||
| | ||
LL | impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {} | ||
| ----------------------------------------------- first implementation here | ||
LL | impl Trait for for<'c> fn(&'c u32, &'c u32) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u32, &'b u32)` | ||
| | ||
= warning: the behavior may change in a future release | ||
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105> | ||
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details | ||
= note: `#[warn(coherence_leak_check)]` on by default | ||
|
||
error: aborting due to 1 previous error | ||
warning: 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
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
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
11 changes: 11 additions & 0 deletions
11
tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-covariant.stderr
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,11 @@ | ||
error: implementation of `Trait` is not general enough | ||
--> $DIR/hrtb-exists-forall-trait-covariant.rs:33:5 | ||
| | ||
LL | foo::<()>(); | ||
| ^^^^^^^^^^^ implementation of `Trait` is not general enough | ||
| | ||
= note: `()` must implement `Trait<for<'b> fn(fn(&'b u32))>` | ||
= note: ...but it actually implements `Trait<fn(fn(&'0 u32))>`, for some specific lifetime `'0` | ||
|
||
error: aborting due to 1 previous error | ||
|
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
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 @@ | ||
error[E0308]: `match` arms have incompatible types | ||
--> $DIR/old-lub-glb-hr-eq.rs:13:14 | ||
| | ||
LL | let z = match 22 { | ||
| _____________- | ||
LL | | 0 => x, | ||
| | - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8)` | ||
LL | | _ => y, | ||
| | ^ one type is more general than the other | ||
LL | | | ||
LL | | }; | ||
| |_____- `match` arms have incompatible types | ||
| | ||
= note: expected fn pointer `for<'a, 'b> fn(&'a _, &'b _)` | ||
found fn pointer `for<'a> fn(&'a _, &'a _)` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
8 changes: 8 additions & 0 deletions
8
tests/ui/traits/next-solver/member-constraints-in-root-universe.stderr
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,8 @@ | ||
error: the type `<for<'a, 'b> fn(&'a u8, &'b u8) as Trait>::Ty` is not well-formed | ||
--> $DIR/member-constraints-in-root-universe.rs:12:16 | ||
| | ||
LL | fn test<'a>(_: <fn(&u8, &u8) as Trait>::Ty) -> impl Sized { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|