mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 10:07:30 +00:00
21 lines
361 B
Rust
21 lines
361 B
Rust
// check-pass
|
|
|
|
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
|
|
|
|
#![warn(clippy::unsound_collection_transmute)]
|
|
|
|
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() {}
|