-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Make sure to ignore elided lifetimes when pointing at args for fulfillment errors #132935
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 |
---|---|---|
|
@@ -15,10 +15,10 @@ LL | for<'b> <(T,) as X<'b, T>>::U: Clone, | |
| ^^^^^ required by this bound in `X` | ||
|
||
error[E0277]: the trait bound `str: Clone` is not satisfied | ||
--> $DIR/hr-associated-type-bound-param-4.rs:18:5 | ||
--> $DIR/hr-associated-type-bound-param-4.rs:18:18 | ||
| | ||
LL | <(i32,) as X<i32>>::f("abc"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str` | ||
| ^^^ the trait `Clone` is not implemented for `str` | ||
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 feels like a worse error? The carets point to 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 a preexisting consequence of the algorithm. I'm just fixing an off-by-N bug. |
||
| | ||
= help: the trait `Clone` is implemented for `String` | ||
note: required by a bound in `X::f` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,10 @@ LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone, | |
| ^^^^^ required by this bound in `X` | ||
|
||
error[E0277]: the trait bound `str: Clone` is not satisfied | ||
--> $DIR/hr-associated-type-bound-param-5.rs:36:5 | ||
--> $DIR/hr-associated-type-bound-param-5.rs:36:15 | ||
| | ||
LL | <i32 as X<Box<i32>>>::f("abc"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str` | ||
| ^^^^^^^^ the trait `Clone` is not implemented for `str` | ||
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. ditto |
||
| | ||
= help: the trait `Clone` is implemented for `String` | ||
note: required by a bound in `X::f` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,22 @@ LL | <(i32,) as X<i32>>::f("abc"); | |
| | ||
= help: the trait `X<'_, T>` is implemented for `(S,)` | ||
|
||
error[E0277]: the trait bound `for<'b> i32: X<'b, i32>` is not satisfied | ||
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. We have a duplicated error here b/c we can only refine one of two copies of this fulfillment error: one that comes from well-formedness, and one that comes from the predicates_of query. I think it's fine to ignore this regression, since it's a net improvement for other errors. |
||
--> $DIR/hr-associated-type-bound-param-6.rs:18:18 | ||
| | ||
LL | <(i32,) as X<i32>>::f("abc"); | ||
| ^^^ the trait `for<'b> X<'b, i32>` is not implemented for `i32` | ||
| | ||
= help: the trait `X<'_, T>` is implemented for `(S,)` | ||
note: required by a bound in `X::f` | ||
--> $DIR/hr-associated-type-bound-param-6.rs:3:16 | ||
| | ||
LL | for<'b> T: X<'b, T>, | ||
| ^^^^^^^^ required by this bound in `X::f` | ||
... | ||
LL | fn f(x: &<T as X<'_, T>>::U) { | ||
| - required by a bound in this associated function | ||
|
||
error[E0277]: the trait bound `i32: X<'_, i32>` is not satisfied | ||
--> $DIR/hr-associated-type-bound-param-6.rs:18:27 | ||
| | ||
|
@@ -25,6 +41,6 @@ LL | <(i32,) as X<i32>>::f("abc"); | |
| | ||
= help: the trait `X<'_, T>` is implemented for `(S,)` | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error[E0277]: the trait bound `for<'a> T: Trait<'a, '_>` is not satisfied | ||
--> $DIR/candidate-from-env-universe-err-2.rs:15:5 | ||
--> $DIR/candidate-from-env-universe-err-2.rs:15:15 | ||
| | ||
LL | impl_hr::<T>(); | ||
| ^^^^^^^^^^^^^^ the trait `for<'a> Trait<'a, '_>` is not implemented for `T` | ||
| ^ the trait `for<'a> Trait<'a, '_>` is not implemented for `T` | ||
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 one is better, the carets point to |
||
| | ||
note: required by a bound in `impl_hr` | ||
--> $DIR/candidate-from-env-universe-err-2.rs:12:19 | ||
|
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.
This is a great example of the bug. We have
X<'a, T>
above, but have only specified the type parameter. Since we were basically trying to index at1
into a list of1
, we would fail. Now we properly adjust the index to account for the lifetime not being there :D