Skip to content
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

"0 elided lifetimes" is still confusing #30255

Closed
sanxiyn opened this issue Dec 7, 2015 · 0 comments
Closed

"0 elided lifetimes" is still confusing #30255

sanxiyn opened this issue Dec 7, 2015 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@sanxiyn
Copy link
Member

sanxiyn commented Dec 7, 2015

struct S<'a> {
    field: &'a i32,
}
fn f(a: &S, b: i32) -> &i32 {
    panic!();
}
test.rs:4:24: 4:28 help: this function's return type contains a borrowed value,
but the signature does not say whether it is borrowed from one of `a`'s 2 elided lifetimes
or one of `b`'s 0 elided lifetimes

See #30086 for a similar issue which has been fixed.

@sanxiyn sanxiyn added the A-diagnostics Area: Messages for errors, warnings, and lints label Dec 7, 2015
nham pushed a commit to nham/rust that referenced this issue May 18, 2016
When displaying the function parameters for a lifetime elision error message,
this changes it to first filter out the parameters that don't have elided
lifetimes.

Fixes rust-lang#30255.
Manishearth added a commit to Manishearth/rust that referenced this issue May 19, 2016
Only print parameters with elided lifetimes in elision error messages.

When displaying the function parameters for a lifetime elision error message,
this changes it to first filter out the parameters that don't have elided
lifetimes.

Fixes rust-lang#30255.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

1 participant