Skip to content

"0 elided lifetimes" is still confusing #30255

Closed
@sanxiyn

Description

@sanxiyn
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions