Skip to content

impl Trait Lifetime Elision #43396

Closed
Closed
@cramertj

Description

@cramertj

The following ICEs:
fn foo(x: &bool) -> impl Into<&bool> { x }

The message is: error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:618: escaping regions in predicate Obligation(predicate=Binder(TraitPredicate(<_ as std::convert::Into<&bool>>)),depth=0) --> src/main.rs:6:21.

Should we explicitly disallow lifetime elision in impl Trait?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-needs-decisionIssue: In need of a decision.T-langRelevant to the language 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