about summary refs log tree commit diff
path: root/tests/ui/issues/issue-32377.rs
blob: 6737f9820efd93b6942a6acdf0871cc4194d6df2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ normalize-stderr: "\d+ bits" -> "N bits"

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) }
    //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
}

fn main() {}