-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add ui/higher-ranked/trait-bounds/normalize-generic-arg.rs
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
tests/ui/higher-ranked/trait-bounds/normalize-generic-arg.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,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() {} |