-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
//#![feature(in_band_lifetimes)]
fn foo(data: &'a mut [u32]) -> &'a [u32] {
data
}
fn main() {}
Gives (rustc 1.46.0-nightly 50fc24d 2020-06-25):
error[E0261]: use of undeclared lifetime name `'a`
--> ...\test.rs:2:15
|
2 | fn foo(data: &'a mut [u32]) -> &'a [u32] {
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `<'a>`
error[E0261]: use of undeclared lifetime name `'a`
--> ...\test.rs:2:33
|
2 | fn foo(data: &'a mut [u32]) -> &'a [u32] {
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `<'a>`
Like most other features I'd like rustc to suggest using in_band_lifetimes if it's a Nightly compiler.
Metadata
Metadata
Assignees
Labels
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.