-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deeply normalize associated type bounds before proving them
- Loading branch information
1 parent
da663c7
commit 40ded6d
Showing
10 changed files
with
92 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0478]: lifetime bound not satisfied | ||
--> $DIR/issue-91883.rs:34:24 | ||
| | ||
LL | type Cursor<'tx> = CursorImpl<'tx>; | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
note: lifetime parameter instantiated with the lifetime `'db` as defined here | ||
--> $DIR/issue-91883.rs:33:6 | ||
| | ||
LL | impl<'db> Transaction<'db> for TransactionImpl<'db> { | ||
| ^^^ | ||
note: but lifetime parameter must outlive the lifetime `'tx` as defined here | ||
--> $DIR/issue-91883.rs:34:17 | ||
| | ||
LL | type Cursor<'tx> = CursorImpl<'tx>; | ||
| ^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0478`. |
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
12 changes: 1 addition & 11 deletions
12
tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.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
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,14 @@ | ||
// Make sure that, like the old trait solver, we end up requiring that the WC of | ||
// impl GAT matches that of the trait. This is not a restriction that we *need*, | ||
// but is a side-effect of registering the where clauses when normalizing the GAT | ||
// when proving it satisfies its item bounds. | ||
|
||
trait Foo { | ||
type T<'a>: Sized where Self: 'a; | ||
} | ||
|
||
impl Foo for &() { | ||
type T<'a> = (); //~ the type `&()` does not fulfill the required lifetime | ||
} | ||
|
||
fn main() {} |
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,22 @@ | ||
error[E0477]: the type `&()` does not fulfill the required lifetime | ||
--> $DIR/gat-wf.rs:11:18 | ||
| | ||
LL | type T<'a>: Sized where Self: 'a; | ||
| ----------------- definition of `T` from trait | ||
... | ||
LL | type T<'a> = (); | ||
| ^^ | ||
| | ||
note: type must outlive the lifetime `'a` as defined here | ||
--> $DIR/gat-wf.rs:11:12 | ||
| | ||
LL | type T<'a> = (); | ||
| ^^ | ||
help: copy the `where` clause predicates from the trait | ||
| | ||
LL | type T<'a> = () where Self: 'a; | ||
| ++++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0477`. |