]> git.lizzy.rs Git - rust.git/commitdiff
Rustup to rustc 1.33.0-nightly (ddab10a69 2018-12-23)
authorbjorn3 <bjorn3@users.noreply.github.com>
Mon, 24 Dec 2018 13:50:18 +0000 (14:50 +0100)
committerbjorn3 <bjorn3@users.noreply.github.com>
Mon, 24 Dec 2018 13:50:18 +0000 (14:50 +0100)
example/mini_core.rs
src/constant.rs

index 83dd4f10f5e9516d985da83904791b6cabe07d11..24429555a5fd7470dd8d36dde7b43f19c88821ad 100644 (file)
@@ -27,6 +27,13 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
 // *mut T -> *mut U
 impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
 
+#[lang = "receiver"]
+pub trait Receiver {}
+
+impl<T: ?Sized> Receiver for &T {}
+impl<T: ?Sized> Receiver for &mut T {}
+impl<T: ?Sized> Receiver for Box<T> {}
+
 #[lang = "copy"]
 pub unsafe trait Copy {}
 
index 366b06a127660e48175f1ee6a70fe81446a64281..1b3cd0c0b3609e3acda17c02716342264e650728 100644 (file)
@@ -150,7 +150,7 @@ fn trans_const_place<'a, 'tcx: 'a>(
             })),
             None,
         )?;
-        let ptr = ecx.allocate(op.layout, MemoryKind::Stack)?;
+        let ptr = ecx.allocate(op.layout, MemoryKind::Stack);
         ecx.copy_op(op, ptr.into())?;
         let alloc = ecx.memory().get(ptr.to_ptr()?.alloc_id)?;
         Ok(fx.tcx.intern_const_alloc(alloc.clone()))
@@ -372,8 +372,8 @@ fn tag_new_allocation(
         _: &mut EvalContext<'a, 'mir, 'tcx, Self>,
         ptr: Pointer,
         _: MemoryKind<!>,
-    ) -> EvalResult<'tcx, Pointer> {
-        Ok(ptr)
+    ) -> Pointer {
+        ptr
     }
 
     fn stack_push(_: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>{