2023-04-20 09:37:15 -05:00
|
|
|
//@check-pass
|
2019-12-31 00:44:04 -06:00
|
|
|
|
|
|
|
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
|
|
|
|
|
2020-01-01 18:32:55 -06:00
|
|
|
#![warn(clippy::unsound_collection_transmute)]
|
2022-02-01 13:53:12 -06:00
|
|
|
#![allow(clippy::transmute_undefined_repr)]
|
2020-01-01 18:32:55 -06:00
|
|
|
|
2019-12-31 00:44:04 -06: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() {}
|