Skip to content

rustc --explain E0487 is inconsistent and unclear #67040

Closed
@ryanswilson59

Description

@ryanswilson59

In the text visible at https://doc.rust-lang.org/1.25.0/error-index.html#E0478
We first see

In this example, the 'SnowWhite lifetime is supposed to outlive the 'kiss lifetime

struct Prince<'kiss, 'SnowWhite: 'kiss> { // You say here that 'kiss must live
                                          // longer than 'SnowWhite.
    child: Box<Wedding<'kiss> + 'SnowWhite>, // And now it's all good!
}

The comment directly contradicts that 'SnowWhite should outlive 'kiss, thus making it unclear what the code actually does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions