2019-12-31 07:44:04 +01:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
|
|
|
|
|
2020-01-02 01:32:55 +01:00
|
|
|
#![warn(clippy::unsound_collection_transmute)]
|
|
|
|
|
2019-12-31 07:44:04 +01:00
|
|
|
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() {}
|