Skip to content

E0477 triggered with current nightly #101951

Closed
@geeklint

Description

@geeklint

I discovered that some code I had previously been using no longer compiles with the current nightly. It gives E0477 which, as other issues have pointed out, is incorrectly described as "no longer emitted by the compiler".

Code

Link to Playground

I expected to see this happen: The code compiles successfully

Instead, this happened: I get this compiler error:

error[E0477]: the type `PrettyCondo<'_>` does not fulfill the required lifetime
  --> src/lib.rs:41:5
   |
41 |     fn add_building(&mut self, _building: &mut PrettyCondo<'_>) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: type must outlive the anonymous lifetime as defined here
  --> src/lib.rs:41:21
   |
41 |     fn add_building(&mut self, _building: &mut PrettyCondo<'_>) {
   |                     ^

For more information about this error, try `rustc --explain E0477`.
error: could not compile `e0477-test` due to previous error

Result of cargo-bisect-rustc

searched nightlies: from nightly-2022-08-08 to nightly-2022-09-17
regressed nightly: nightly-2022-08-10
searched commit range: f03ce30...34a6cae
regressed commit: 63e4312

bisected with cargo-bisect-rustc v0.6.4

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc 

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-trait-systemArea: Trait systemC-bugCategory: This is a bug.P-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions