-
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.
Recover from default value for a lifetime in generic parameters.
- Loading branch information
Showing
5 changed files
with
41 additions
and
1 deletion.
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
6 changes: 6 additions & 0 deletions
6
tests/ui/lifetimes/issue-107492-default-value-for-lifetime.rs
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,6 @@ | ||
pub struct DefaultLifetime<'a, 'b = 'static> { | ||
//~^ ERROR unexpected default lifetime parameter | ||
_marker: std::marker::PhantomData<&'a &'b ()>, | ||
} | ||
|
||
fn main(){} |
8 changes: 8 additions & 0 deletions
8
tests/ui/lifetimes/issue-107492-default-value-for-lifetime.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: unexpected default lifetime parameter | ||
--> $DIR/issue-107492-default-value-for-lifetime.rs:1:35 | ||
| | ||
LL | pub struct DefaultLifetime<'a, 'b = 'static> { | ||
| ^^^^^^^^^ lifetime parameters cannot have default values | ||
|
||
error: aborting due to previous error | ||
|