]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / compiler / rustc_codegen_cranelift / example / mini_core_hello_world.rs
index c4730581335ecbffa29d3c58fc1cfc187b052b86..85ca908d0a266f2e1012ea4d166d1068d7e538dc 100644 (file)
@@ -122,7 +122,7 @@ fn call_return_u128_pair() {
 #[allow(unreachable_code)] // FIXME false positive
 fn main() {
     take_unique(Unique {
-        pointer: 0 as *const (),
+        pointer: unsafe { NonNull(1 as *mut ()) },
         _marker: PhantomData,
     });
     take_f32(0.1);
@@ -173,7 +173,7 @@ fn main() {
         assert!(intrinsics::needs_drop::<NoisyDrop>());
 
         Unique {
-            pointer: 0 as *const &str,
+            pointer: NonNull(1 as *mut &str),
             _marker: PhantomData,
         } as Unique<dyn SomeTrait>;