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:12:43 +0000
commitcf94bdc0742c13e2a0cac864c478b8626b266e1b (patch)
tree044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /compiler/rustc_error_codes/src/error_codes/E0161.md
parentAdding debian version 1.65.0+dfsg1-2. (diff)
downloadrustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz
rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.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!
}