about summary refs log tree commit diff
path: root/tests/ui/transmute/transmute-same-associated-type.rs
blob: 8bc452c6df4f634bd71caf59d75c3c13a895038e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Verify transmuting is allowed when `Src` and `Dst` are the same associated type.

//@ check-pass

trait Foo {
    type Bar;
}

unsafe fn noop<F: Foo>(foo: F::Bar) -> F::Bar {
    ::std::mem::transmute(foo)
}

fn main() {}