summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/ice-4968.rs
blob: 50473868005e03f6e6cb81c319b95d66eefbc1a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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() {}