diff options
Diffstat (limited to 'tests/ui-stable/transmute-illegal.rs')
-rw-r--r-- | tests/ui-stable/transmute-illegal.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui-stable/transmute-illegal.rs b/tests/ui-stable/transmute-illegal.rs new file mode 100644 index 0000000..74b8439 --- /dev/null +++ b/tests/ui-stable/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); |