aboutsummaryrefslogtreecommitdiff
path: root/tests/ui-msrv/transmute-illegal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui-msrv/transmute-illegal.rs')
-rw-r--r--tests/ui-msrv/transmute-illegal.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui-msrv/transmute-illegal.rs b/tests/ui-msrv/transmute-illegal.rs
new file mode 100644
index 0000000..74b8439
--- /dev/null
+++ b/tests/ui-msrv/transmute-illegal.rs
@@ -0,0 +1,10 @@
+// Copyright 2022 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+extern crate zerocopy;
+
+fn main() {}
+
+// It is unsound to inspect the usize value of a pointer during const eval.
+const POINTER_VALUE: usize = zerocopy::transmute!(&0usize as *const usize);