]> git.proxmox.com Git - rustc.git/blame - src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / higher-rank-trait-bounds / normalize-under-binder / issue-62529-3.rs
CommitLineData
94222f64
XL
1trait ATC<'a> {
2 type Type: Sized;
3}
4
5trait WithDefault: for<'a> ATC<'a> {
6 fn with_default<F: for<'a> Fn(<Self as ATC<'a>>::Type)>(f: F);
7}
8
9fn call<'b, T: for<'a> ATC<'a>, F: for<'a> Fn(<T as ATC<'a>>::Type)>(
10 f: F,
11 x: <T as ATC<'b>>::Type,
12) {
13 f(x);
14}
15
16impl<'a> ATC<'a> for () {
17 type Type = Self;
18}
19
20impl WithDefault for () {
21 fn with_default<F: for<'a> Fn(<Self as ATC<'a>>::Type)>(f: F) {
22 // Errors with a bogus type mismatch.
23 //f(());
24 // Going through another generic function works fine.
25 call(f, ());
26 //~^ expected a
27 }
28}
29
30fn main() {
31 // <()>::with_default(|_| {});
32}