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.
Report diagnostics at the actually actionable site
- Loading branch information
Showing
5 changed files
with
43 additions
and
21 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,25 @@ | ||
// run-rustfix | ||
|
||
pub trait Trait {} | ||
|
||
pub struct Foo; | ||
|
||
impl Trait for Foo {} | ||
|
||
fn foo<'x, P>( | ||
_post: P, | ||
x: &'x Foo, | ||
) -> &'x impl Trait { | ||
x | ||
} | ||
|
||
pub fn bar<'t, T: 't>( | ||
//~^ HELP: consider adding an explicit lifetime bound... | ||
post: T, | ||
x: &'t Foo, | ||
) -> &'t impl Trait { | ||
foo(post, x) | ||
//~^ 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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
trait Trait {} | ||
// run-rustfix | ||
|
||
struct Foo; | ||
pub trait Trait {} | ||
|
||
pub struct Foo; | ||
|
||
impl Trait for Foo {} | ||
|
||
fn foo<'x, P>( | ||
post: P, | ||
_post: P, | ||
x: &'x Foo, | ||
) -> &'x impl Trait { | ||
//~^ HELP: consider adding an explicit lifetime bound... | ||
x | ||
} | ||
|
||
fn bar<'t, T>( | ||
pub fn bar<'t, T>( | ||
//~^ HELP: consider adding an explicit lifetime bound... | ||
post: T, | ||
x: &'t Foo, | ||
) -> &'t impl Trait { | ||
foo(post, x) | ||
//~^ ERROR: the opaque type `foo<T>::{opaque#0}` 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