blob: e0510d942c200843abd0432b756f60ab9002d265 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// check-pass
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
#![warn(clippy::unsound_collection_transmute)]
#![allow(clippy::transmute_undefined_repr)]
trait Trait {
type Assoc;
}
use std::mem::{self, ManuallyDrop};
#[allow(unused)]
fn func<T: Trait>(slice: Vec<T::Assoc>) {
unsafe {
let _: Vec<ManuallyDrop<T::Assoc>> = mem::transmute(slice);
}
}
fn main() {}
|