Skip to content

Internal Compiler Error for needless_pass_by_value: cannot relate region: ReErased #10344

@base0x10

Description

@base0x10

Summary

Rustc panics when running clippy with the lint needless_pass_by_value from the pedantic group. The error seems to be triggered when type_allowed_to_implement_copy is checked for parameters with erased lifetimes. I've produced a minimal failing input and found the first nightly release impacted.

Error

Internal compiler error: compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs:203:17: cannot relate region: ReErased.

Full backtrace copied into this gist.

Reproduction

#![warn(clippy::needless_pass_by_value)]

struct Input<'a> {
        _baz: &'a u32,
}

fn funct(foo: Input) {
    let _bar = &foo;
}

Versions

Up to date beta and nightly toolchains are impacted but not stable. I bisected nightly toolchains and found that nightly-2023-01-21 is not impacted but nightly-2023-1-22 is impacted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions