mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 00:20:36 +00:00
19 lines
390 B
Rust
19 lines
390 B
Rust
// 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() {}
|