From cf94bdc0742c13e2a0cac864c478b8626b266e1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_error_codes/src/error_codes/E0161.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_error_codes/src/error_codes/E0161.md') diff --git a/compiler/rustc_error_codes/src/error_codes/E0161.md b/compiler/rustc_error_codes/src/error_codes/E0161.md index ebd2c9769..643990ef1 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0161.md +++ b/compiler/rustc_error_codes/src/error_codes/E0161.md @@ -3,7 +3,6 @@ A value was moved whose size was not known at compile time. Erroneous code example: ```compile_fail,E0161 -#![feature(box_syntax)] trait Bar { fn f(self); } @@ -13,7 +12,7 @@ impl Bar for i32 { } fn main() { - let b: Box = box (0 as i32); + let b: Box = Box::new(0i32); b.f(); // error: cannot move a value of type dyn Bar: the size of dyn Bar cannot // be statically determined @@ -27,8 +26,6 @@ either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move it around as usual. Example: ``` -#![feature(box_syntax)] - trait Bar { fn f(&self); } @@ -38,7 +35,7 @@ impl Bar for i32 { } fn main() { - let b: Box = box (0 as i32); + let b: Box = Box::new(0i32); b.f(); // ok! } -- cgit v1.2.3