diff options
Diffstat (limited to 'tests/ui/consts/raw-ptr-temp-const.rs')
| -rw-r--r-- | tests/ui/consts/raw-ptr-temp-const.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/consts/raw-ptr-temp-const.rs b/tests/ui/consts/raw-ptr-temp-const.rs new file mode 100644 index 00000000000..deb51cd505c --- /dev/null +++ b/tests/ui/consts/raw-ptr-temp-const.rs @@ -0,0 +1,6 @@ +// A variant of raw-ptr-const that directly constructs a raw pointer. + +const CONST_RAW: *const Vec<i32> = std::ptr::addr_of!(Vec::new()); +//~^ ERROR cannot take address of a temporary + +fn main() {} |
