-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deeply normalize item bounds in new solver #137000
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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`. |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also the cause for the failures in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new solver test without enabling the new solver? also, instead of adding a new test, maybe revisions and a comment in tests/ui/generic-associated-types/issue-91883.rs are enough? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kinda prefer an explicit test. 91833 is a mess. I'll add flag, tho, whoops. |
||
// 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() {} |
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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below for why I ripped out the GATs from this test.