summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0161.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:13:23 +0000
commit20431706a863f92cb37dc512fef6e48d192aaf2c (patch)
tree2867f13f5fd5437ba628c67d7f87309ccadcd286 /compiler/rustc_error_codes/src/error_codes/E0161.md
parentReleasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff)
downloadrustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz
rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0161.md7
1 files changed, 2 insertions, 5 deletions
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<dyn Bar> = box (0 as i32);
+ let b: Box<dyn Bar> = 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<dyn Bar> = box (0 as i32);
+ let b: Box<dyn Bar> = Box::new(0i32);
b.f();
// ok!
}