forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#125667 - oli-obk:taintify, r=TaKO8Ki Silence follow-up errors directly based on error types and regions During type_of, we used to just return an error type if there were any errors encountered. This is problematic, because it means a struct declared as `struct Foo<'static>` will end up not finding any inherent or trait impls because those impl blocks' `Self` type will be `{type error}` instead of `Foo<'re_error>`. Now it's the latter, silencing nonsensical follow-up errors about `Foo` not having any methods. Unfortunately that now allows for new follow-up errors, because borrowck treats `'re_error` as `'static`, causing nonsensical errors about non-error lifetimes not outliving `'static`. So what I also did was to just strip all outlives bounds that borrowck found, thus never letting it check them. There are probably more nuanced ways to do this, but I worried there would be other nonsensical errors if some outlives bounds were missing. Also from the test changes, it looked like an improvement everywhere.
- Loading branch information
Showing
43 changed files
with
271 additions
and
297 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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
// This test ensures that it's not crashing rustdoc. | ||
|
||
pub struct Foo<'a, 'b, T> { | ||
field1: dyn Bar<'a, 'b,>, | ||
field1: dyn Bar<'a, 'b>, | ||
//~^ ERROR | ||
//~| ERROR | ||
//~| ERROR | ||
} | ||
|
||
pub trait Bar<'x, 's, U> | ||
where U: 'x, | ||
Self:'x, | ||
Self:'s | ||
{} | ||
where | ||
U: 'x, | ||
Self: 'x, | ||
Self: 's, | ||
{ | ||
} |
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,26 +1,43 @@ | ||
error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied | ||
--> $DIR/unable-fulfill-trait.rs:4:17 | ||
| | ||
LL | field1: dyn Bar<'a, 'b,>, | ||
LL | field1: dyn Bar<'a, 'b>, | ||
| ^^^ expected 1 generic argument | ||
| | ||
note: trait defined here, with 1 generic parameter: `U` | ||
--> $DIR/unable-fulfill-trait.rs:9:11 | ||
--> $DIR/unable-fulfill-trait.rs:10:11 | ||
| | ||
LL | pub trait Bar<'x, 's, U> | ||
| ^^^ - | ||
help: add missing generic argument | ||
| | ||
LL | field1: dyn Bar<'a, 'b, U,>, | ||
LL | field1: dyn Bar<'a, 'b, U>, | ||
| +++ | ||
|
||
error[E0227]: ambiguous lifetime bound, explicit lifetime bound required | ||
--> $DIR/unable-fulfill-trait.rs:4:13 | ||
| | ||
LL | field1: dyn Bar<'a, 'b,>, | ||
| ^^^^^^^^^^^^^^^^ | ||
LL | field1: dyn Bar<'a, 'b>, | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
error[E0478]: lifetime bound not satisfied | ||
--> $DIR/unable-fulfill-trait.rs:4:13 | ||
| | ||
LL | field1: dyn Bar<'a, 'b>, | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
note: lifetime parameter instantiated with the lifetime `'b` as defined here | ||
--> $DIR/unable-fulfill-trait.rs:3:20 | ||
| | ||
LL | pub struct Foo<'a, 'b, T> { | ||
| ^^ | ||
note: but lifetime parameter must outlive the lifetime `'a` as defined here | ||
--> $DIR/unable-fulfill-trait.rs:3:16 | ||
| | ||
LL | pub struct Foo<'a, 'b, T> { | ||
| ^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0227. | ||
Some errors have detailed explanations: E0107, E0227, E0478. | ||
For more information about an error, try `rustc --explain E0107`. |
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
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
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.