]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/ice-4968.rs
e0510d942c200843abd0432b756f60ab9002d265
[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 #![allow(clippy::transmute_undefined_repr)]
7
8 trait Trait {
9     type Assoc;
10 }
11
12 use std::mem::{self, ManuallyDrop};
13
14 #[allow(unused)]
15 fn func<T: Trait>(slice: Vec<T::Assoc>) {
16     unsafe {
17         let _: Vec<ManuallyDrop<T::Assoc>> = mem::transmute(slice);
18     }
19 }
20
21 fn main() {}