Skip to content

deduce_closure_signature bails on aliases referencing self #138

Closed
rust-lang/rust
#135892
@lcnr

Description

@lcnr
pub trait Fn0: Fn(i32) -> Self::Out {
    type Out;
}

impl<F: Fn(i32) -> ()> Fn0 for F {
    type Out = ();
}

pub fn closure_typer(_: impl Fn0) {}

fn main() {
    closure_typer(move |x| {
        let _: i64 = x.into();
    });
}

affected tests

  • tests/ui/closures/supertrait-hint-references-assoc-ty.rs
  • tests/ui/borrowck/issue-103095.rs

Metadata

Metadata

Assignees

Type

No type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions