rust/tests/ui/static/extern-static-normalization-failure-issue-148161.rs

21 lines
460 B
Rust

// Regression test for https://github.com/rust-lang/rust/issues/148161
trait Trait {
type Assoc;
}
impl Trait for u8 {
type Assoc = i8;
}
struct Struct<T: Trait> {
member: T::Assoc,
}
unsafe extern "C" {
// This used to be an ICE due to normalization failure on `<Struct<i8> as Trait>::Assoc`
// while wf checking this static item.
static VAR: Struct<i8>;
//~^ ERROR: the trait bound `i8: Trait` is not satisfied
}
fn main() {}