forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#86505 - JohnTitor:fix-86483, r=jackh726
Do not panic in `return_type_impl_trait` Fixes rust-lang#86483
- Loading branch information
Showing
4 changed files
with
61 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Regression test of #86483. | ||
|
||
#![feature(generic_associated_types)] | ||
#![allow(incomplete_features)] | ||
|
||
pub trait IceIce<T> //~ ERROR: the parameter type `T` may not live long enough | ||
where | ||
for<'a> T: 'a, | ||
{ | ||
type Ice<'v>: IntoIterator<Item = &'v T>; | ||
//~^ ERROR: the parameter type `T` may not live long enough | ||
//~| ERROR: the parameter type `T` may not live long enough | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
error[E0311]: the parameter type `T` may not live long enough | ||
--> $DIR/issue-86483.rs:6:1 | ||
| | ||
LL | pub trait IceIce<T> | ||
| ^ - help: consider adding an explicit lifetime bound...: `T: 'a` | ||
| _| | ||
| | | ||
LL | | where | ||
LL | | for<'a> T: 'a, | ||
LL | | { | ||
... | | ||
LL | | | ||
LL | | } | ||
| |_^ ...so that the type `T` will meet its required lifetime bounds | ||
|
||
error[E0311]: the parameter type `T` may not live long enough | ||
--> $DIR/issue-86483.rs:10:5 | ||
| | ||
LL | pub trait IceIce<T> | ||
| - help: consider adding an explicit lifetime bound...: `T: 'a` | ||
... | ||
LL | type Ice<'v>: IntoIterator<Item = &'v T>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds | ||
|
||
error[E0309]: the parameter type `T` may not live long enough | ||
--> $DIR/issue-86483.rs:10:32 | ||
| | ||
LL | pub trait IceIce<T> | ||
| - help: consider adding an explicit lifetime bound...: `T: 'v` | ||
... | ||
LL | type Ice<'v>: IntoIterator<Item = &'v T>; | ||
| ^^^^^^^^^^^^ ...so that the reference type `&'v T` does not outlive the data it points at | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0309`. |