Skip to content

Commit 238fcba

Browse files
committed
tests: Add ui/higher-ranked/trait-bounds/normalize-generic-arg.rs
1 parent 2d28b63 commit 238fcba

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ check-pass
2+
3+
/// This triggers an ICE with (and without) `--emit metadata` on
4+
/// ```
5+
/// rustc +nightly-2023-01-09 tests/ui/higher-ranked/trait-bounds/normalize-generic-arg.rs
6+
/// ```
7+
/// but was unknowingly fixed by <https://github.com/rust-lang/rust/pull/101947>
8+
/// in `nightly-2023-01-10`.
9+
10+
trait Trait<'a> {
11+
type Assoc;
12+
}
13+
14+
fn foo<T: for<'a> Trait<'a>>() -> for<'a> fn(<T as Trait<'a>>::Assoc) {
15+
todo!()
16+
}
17+
18+
fn bar<T: for<'a> Trait<'a>>() {
19+
let _: for<'a> fn(<_ as Trait<'a>>::Assoc) = foo::<T>();
20+
}
21+
22+
fn main() {}

0 commit comments

Comments
 (0)