Rollup merge of #104038 - compiler-errors:super-norm-closure-sig, r=lcnr

Normalize types when deducing closure signature from supertraits

Elaborated supertraits should be normalized, since there's no guarantee they don't contain projections 😅

Fixes #104025
r? types
This commit is contained in:
Dylan DPC 2022-11-07 18:35:25 +05:30 committed by GitHub
commit f0bd2cdde4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View file

@ -0,0 +1,17 @@
// check-pass
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();
});
}