]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/ice-4968.rs
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / tests / ui / crashes / ice-4968.rs
1 // check-pass
2
3 // Test for https://github.com/rust-lang/rust-clippy/issues/4968
4
5 #![warn(clippy::unsound_collection_transmute)]
6
7 trait Trait {
8     type Assoc;
9 }
10
11 use std::mem::{self, ManuallyDrop};
12
13 #[allow(unused)]
14 fn func<T: Trait>(slice: Vec<T::Assoc>) {
15     unsafe {
16         let _: Vec<ManuallyDrop<T::Assoc>> = mem::transmute(slice);
17     }
18 }
19
20 fn main() {}