Skip to content

ICE using parenthetical trait notation in impls  #19982

Closed
@nikomatsakis

Description

@nikomatsakis

The following test will ICE:

#![feature(unboxed_closures)]
struct Foo;
impl Fn(&int) for Foo { }

The workaround for now is to write:

impl<'a> Fn(&'a int) for Foo { }

It would be better if this were implicit. This seems related to lifetime elision, which also is supposed to permit elided parameters in impls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions