rust-clippy/tests/ui/crashes/ice-4968.rs

20 lines
390 B
Rust
Raw Normal View History

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