-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
52 additions
and
250 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
2 changes: 1 addition & 1 deletion
2
tests/ui/impl-trait/defining-use-captured-non-universal-region.infer.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
33 changes: 6 additions & 27 deletions
33
tests/ui/impl-trait/defining-use-captured-non-universal-region.statik.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,33 +1,12 @@ | ||
error: opaque type used twice with different lifetimes | ||
--> $DIR/defining-use-captured-non-universal-region.rs:10:18 | ||
| | ||
LL | let i: i32 = foo::<'static>(); | ||
| ^^^^^^^^^^^^^^^^ lifetime `'static` used here | ||
... | ||
LL | i | ||
| - lifetime `'a` previously used here | ||
| | ||
note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types | ||
--> $DIR/defining-use-captured-non-universal-region.rs:10:18 | ||
| | ||
LL | let i: i32 = foo::<'static>(); | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: opaque type used twice with different lifetimes | ||
--> $DIR/defining-use-captured-non-universal-region.rs:10:18 | ||
| | ||
LL | let i: i32 = foo::<'static>(); | ||
| ^^^^^^^^^^^^^^^^ lifetime `'static` used here | ||
... | ||
LL | i | ||
| - lifetime `'a` previously used here | ||
| | ||
note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types | ||
error[E0792]: expected generic lifetime parameter, found `'static` | ||
--> $DIR/defining-use-captured-non-universal-region.rs:10:18 | ||
| | ||
LL | fn foo<'a>() -> impl Sized + 'a { | ||
| -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type | ||
LL | #[cfg(statik)] | ||
LL | let i: i32 = foo::<'static>(); | ||
| ^^^^^^^^^^^^^^^^ | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0792`. |
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.