summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/ice-4968.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-4968.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/ice-4968.rs b/src/tools/clippy/tests/ui/crashes/ice-4968.rs
new file mode 100644
index 000000000..e0510d942
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/ice-4968.rs
@@ -0,0 +1,21 @@
+// check-pass
+
+// 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() {}