diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-31 11:31:08 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-11-01 16:49:18 +0000 |
| commit | c2f49e9edf2bae4eaede9af13f5dfb80aacb04d1 (patch) | |
| tree | d039fb4f2941d8e90f7302c93509c81b7b3651e5 /tests | |
| parent | 146dafa26277c873172f555017b970ef006d302a (diff) | |
| download | rust-c2f49e9edf2bae4eaede9af13f5dfb80aacb04d1.tar.gz rust-c2f49e9edf2bae4eaede9af13f5dfb80aacb04d1.zip | |
Do not assert in op_to_const.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/mir/issue-117368-print-invalid-constant.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/mir/issue-117368-print-invalid-constant.rs b/tests/ui/mir/issue-117368-print-invalid-constant.rs new file mode 100644 index 00000000000..d9610391941 --- /dev/null +++ b/tests/ui/mir/issue-117368-print-invalid-constant.rs @@ -0,0 +1,11 @@ +// build-pass +// compile-flags:-Zmir-opt-level=4 --emit=mir + +#![feature(allocator_api)] + +use std::alloc::{Allocator, Global, Layout}; + +fn main() { + let layout: Layout = None.unwrap(); + let ptr: *mut u8 = Global.allocate(layout).unwrap().as_ptr() as _; +} |
