-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #51862 - estebank:lifetime-spans, r=nikomatsakis
Point to lifetime spans on lifetime errors
- Loading branch information
Showing
27 changed files
with
236 additions
and
170 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
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
39 changes: 24 additions & 15 deletions
39
src/test/ui/borrowck/regions-bound-missing-bound-in-impl.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,50 +1,59 @@ | ||
error[E0195]: lifetime parameters or bounds on method `no_bound` do not match the trait declaration | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:28:5 | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:29:16 | ||
| | ||
LL | fn no_bound<'b>(self, b: Inv<'b>); | ||
| ---------------------------------- lifetimes in impl do not match this method in trait | ||
| ---- lifetimes in impl do not match this method in trait | ||
... | ||
LL | fn no_bound<'b:'a>(self, b: Inv<'b>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait | ||
| ^^^^^^^ lifetimes do not match method in trait | ||
|
||
error[E0195]: lifetime parameters or bounds on method `has_bound` do not match the trait declaration | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:32:5 | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:33:17 | ||
| | ||
LL | fn has_bound<'b:'a>(self, b: Inv<'b>); | ||
| -------------------------------------- lifetimes in impl do not match this method in trait | ||
| ------- lifetimes in impl do not match this method in trait | ||
... | ||
LL | fn has_bound<'b>(self, b: Inv<'b>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait | ||
| ^^^^ lifetimes do not match method in trait | ||
|
||
error[E0308]: method not compatible with trait | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:36:5 | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:37:5 | ||
| | ||
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | ||
| | ||
= note: expected type `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)` | ||
found type `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'d>)` | ||
note: the lifetime 'c as defined on the method body at 36:5... | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:36:5 | ||
note: the lifetime 'c as defined on the method body at 37:24... | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:37:24 | ||
| | ||
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: ...does not necessarily outlive the lifetime 'c as defined on the method body at 36:5 | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:36:5 | ||
| ^^ | ||
note: ...does not necessarily outlive the lifetime 'c as defined on the method body at 37:24 | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:37:24 | ||
| | ||
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^ | ||
|
||
error[E0195]: lifetime parameters or bounds on method `wrong_bound2` do not match the trait declaration | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:51:5 | ||
| | ||
LL | fn wrong_bound2<'b,'c,'d:'a+'b>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>); | ||
| ---------------- lifetimes in impl do not match this method in trait | ||
... | ||
LL | fn wrong_bound2(self, b: Inv, c: Inv, d: Inv) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait | ||
|
||
error[E0276]: impl has stricter requirements than trait | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:53:5 | ||
--> $DIR/regions-bound-missing-bound-in-impl.rs:58:5 | ||
| | ||
LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>); | ||
| ------------------------------------------------------- definition of `another_bound` from trait | ||
... | ||
LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't` | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 5 previous errors | ||
|
||
Some errors occurred: E0195, E0276, E0308. | ||
For more information about an error, try `rustc --explain E0195`. |
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
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
Oops, something went wrong.