Skip to content

ICE related to lifetimes and traits #58451

Closed
@WildCryptoFox

Description

@WildCryptoFox

Works fine one stable. ICE on beta and nightly. I couldn't reduce or generalize this error any more than this. It appears to be triggered by some unknown type; notice the inner f() has no argument here, it could be any type that doesn't meet the bounds.

Playground

fn f<I>(i: I)
where
    I: IntoIterator,
    I::Item: for<'a> Into<&'a ()>,
{}

fn main() {
    f(&[f()]);
}

Metadata

Metadata

Labels

A-associated-itemsArea: Associated items (types, constants & functions)A-trait-systemArea: Trait systemA-type-systemArea: Type systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions