Skip to content

rustc: implement error messages from lifetime elision RFC #15838

Closed
@aturon

Description

@aturon

The new lifetime elision rules recently landed, but the error messages for the rules do not reflect the RFC. The function

fn test(s: &str, t: &str) -> &str {
    s
}

produces the error

elision.rs:1:30: 1:34 error: missing lifetime specifier [E0106]
elision.rs:1 fn test(s: &str, t: &str) -> &str {
                                          ^~~~

The error messages are critical for providing a gentle slope from the intuition of borrowing to the mechanism of lifetimes.

cc @pcwalton @nick29581

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsC-enhancementCategory: An issue proposing an enhancement or a PR with one.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions