forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#137000 - compiler-errors:deeply-normalize-i…
…tem-bounds, r=lcnr Deeply normalize item bounds in new solver Built on rust-lang#136863. Fixes rust-lang/trait-system-refactor-initiative#142. Fixes rust-lang/trait-system-refactor-initiative#151. cc rust-lang/trait-system-refactor-initiative#116 First commit reworks candidate preference for projection bounds to prefer param-env projection clauses even if the corresponding trait ref doesn't come from the param-env. Second commit adjusts the associated type item bounds check to deeply normalize in the new solver. This causes some test fallout which I will point out. r? lcnr
- Loading branch information
Showing
11 changed files
with
116 additions
and
75 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
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,16 @@ | ||
//@ compile-flags: -Znext-solver | ||
|
||
// 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,15 @@ | ||
error[E0477]: the type `&()` does not fulfill the required lifetime | ||
--> $DIR/gat-wf.rs:13:18 | ||
| | ||
LL | type T<'a> = (); | ||
| ^^ | ||
| | ||
note: type must outlive the lifetime `'a` as defined here | ||
--> $DIR/gat-wf.rs:13:12 | ||
| | ||
LL | type T<'a> = (); | ||
| ^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0477`. |