-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle fully-qualified paths and add test cases
- Loading branch information
Showing
8 changed files
with
404 additions
and
98 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
37 changes: 37 additions & 0 deletions
37
...gestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.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,37 @@ | ||
error[E0597]: `val` does not live long enough | ||
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:22:9 | ||
| | ||
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> { | ||
| -- lifetime `'a` defined here ------------------- opaque type requires that `val` is borrowed for `'a` | ||
LL | val.use_self() | ||
| ^^^ borrowed value does not live long enough | ||
LL | } | ||
| - `val` dropped here while still borrowed | ||
| | ||
help: you can add a bound to the opaque type to make it last less than `'static` and match `'a` | ||
| | ||
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> + 'a { | ||
| ^^^^ | ||
|
||
error[E0515]: cannot return value referencing function parameter `val` | ||
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:44:9 | ||
| | ||
LL | val.use_self() | ||
| ---^^^^^^^^^^^ | ||
| | | ||
| returns a value referencing data owned by the current function | ||
| `val` is borrowed here | ||
|
||
error[E0515]: cannot return value referencing function parameter `val` | ||
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:110:9 | ||
| | ||
LL | val.use_self() | ||
| ---^^^^^^^^^^^ | ||
| | | ||
| returns a value referencing data owned by the current function | ||
| `val` is borrowed here | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0515, E0597. | ||
For more information about an error, try `rustc --explain E0515`. |
Oops, something went wrong.