mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
27 lines
424 B
Rust
27 lines
424 B
Rust
//@ known-bug: rust-lang/rust#125758
|
|
#![feature(impl_trait_in_assoc_type)]
|
|
|
|
trait Trait: Sized {
|
|
type Assoc2;
|
|
}
|
|
|
|
impl Trait for Bar {
|
|
type Assoc2 = impl std::fmt::Debug;
|
|
}
|
|
|
|
struct Foo {
|
|
field: <Bar as Trait>::Assoc2,
|
|
}
|
|
|
|
enum Bar {
|
|
C = 42,
|
|
D = 99,
|
|
}
|
|
|
|
static BAR: u8 = 42;
|
|
|
|
static FOO2: (&Foo, &<Bar as Trait>::Assoc2) =
|
|
unsafe { (std::mem::transmute(&BAR), std::mem::transmute(&BAR)) };
|
|
|
|
fn main() {}
|