Skip to content

Commit 12a3d72

Browse files
committed
Add regression test for #4968
1 parent f922812 commit 12a3d72

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/ui/crashes/ice-4968.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// check-pass
2+
3+
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
4+
5+
trait Trait {
6+
type Assoc;
7+
}
8+
9+
use std::mem::{self, ManuallyDrop};
10+
11+
#[allow(unused)]
12+
fn func<T: Trait>(slice: Vec<T::Assoc>) {
13+
unsafe {
14+
let _: Vec<ManuallyDrop<T::Assoc>> = mem::transmute(slice);
15+
}
16+
}
17+
18+
fn main() {}

0 commit comments

Comments
 (0)