2024-06-21 15:15:36 +10:00
|
|
|
//@ normalize-stderr-test: "\d+ bits" -> "N bits"
|
2018-08-10 22:46:59 +01:00
|
|
|
|
2016-04-19 17:03:30 +03:00
|
|
|
use std::mem;
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
type Error;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar<U: Foo> {
|
|
|
|
stream: PhantomData<U::Error>,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo<U: Foo>(x: [usize; 2]) -> Bar<U> {
|
|
|
|
unsafe { mem::transmute(x) }
|
2018-12-21 14:15:47 +00:00
|
|
|
//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
|
2016-04-19 17:03:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|