Skip to content

Commit

Permalink
tests: Add ui/higher-ranked/trait-bounds/normalize-generic-arg.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Enselic committed Jun 7, 2024
1 parent 2d28b63 commit 238fcba
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/ui/higher-ranked/trait-bounds/normalize-generic-arg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//@ check-pass

/// This triggers an ICE with (and without) `--emit metadata` on
/// ```
/// rustc +nightly-2023-01-09 tests/ui/higher-ranked/trait-bounds/normalize-generic-arg.rs
/// ```
/// but was unknowingly fixed by <https://github.com/rust-lang/rust/pull/101947>
/// in `nightly-2023-01-10`.

trait Trait<'a> {
type Assoc;
}

fn foo<T: for<'a> Trait<'a>>() -> for<'a> fn(<T as Trait<'a>>::Assoc) {
todo!()
}

fn bar<T: for<'a> Trait<'a>>() {
let _: for<'a> fn(<_ as Trait<'a>>::Assoc) = foo::<T>();
}

fn main() {}

0 comments on commit 238fcba

Please sign in to comment.