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:
commit
f0bd2cdde4
2 changed files with 24 additions and 3 deletions
17
src/test/ui/closures/supertrait-hint-references-assoc-ty.rs
Normal file
17
src/test/ui/closures/supertrait-hint-references-assoc-ty.rs
Normal 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();
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue