-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add long explanation for E0726 #87655
Changes from 1 commit
4336f9d
02af45c
2a3b555
adcb9b9
58fdba8
bfdaf67
6fe2ef5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -424,6 +424,7 @@ E0720: include_str!("./error_codes/E0720.md"), | |
E0722: include_str!("./error_codes/E0722.md"), | ||
E0724: include_str!("./error_codes/E0724.md"), | ||
E0725: include_str!("./error_codes/E0725.md"), | ||
E0725: include_str!("./error_codes/E0726.md"), | ||
E0727: include_str!("./error_codes/E0727.md"), | ||
E0728: include_str!("./error_codes/E0728.md"), | ||
E0729: include_str!("./error_codes/E0729.md"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to remove E0725 from the list of error codes from below (it's not supposed to be declared twice in this file). |
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,19 @@ | ||||||
A lifetime indication has not been added to specify the span of your type. | ||||||
|
||||||
Erroneous code example: | ||||||
|
||||||
```rust | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
struct Abc<'a> { | ||||||
title: &'a str, | ||||||
} | ||||||
|
||||||
struct SomeStruct; | ||||||
|
||||||
impl SomeStruct { | ||||||
pub fn some_fn(&self, abc: Abc) { // error: implicit elided lifetime not allowed here rustc(E0726) | ||||||
// ... | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
Specify the lifetime of struct `Abc` or indicate the anonymous lifetime like `abc: Abc<'_>`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The explanation is a bit lacking no? Maybe try to explain a bit more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, please add a working version of the code example from above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also 726 and not 725.