Add regression test for #4968

This commit is contained in:
Yuki Okushi 2019-12-31 15:44:04 +09:00
parent f922812541
commit 12a3d72462

View file

@ -0,0 +1,18 @@
// check-pass
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
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() {}