mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
26 lines
363 B
Rust
26 lines
363 B
Rust
//@ known-bug: #115435
|
|
//@ edition:2021
|
|
//@ compile-flags: -Copt-level=0
|
|
trait MyTrait {
|
|
type Target: ?Sized;
|
|
}
|
|
|
|
impl<A: ?Sized> MyTrait for A {
|
|
type Target = A;
|
|
}
|
|
|
|
fn main() {
|
|
bug_run::<dyn MyTrait<Target = u8>>();
|
|
}
|
|
|
|
fn bug_run<T: ?Sized>()
|
|
where
|
|
<T as MyTrait>::Target: Sized,
|
|
{
|
|
bug::<T>();
|
|
}
|
|
|
|
fn bug<T>() {
|
|
std::mem::size_of::<T>();
|
|
}
|