-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/ui/closures/supertrait-hint-references-assoc-ty.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
} |