Skip to content

Commit 5c26228

Browse files
committed
rustc: Add long diagnostics for E0161
1 parent 79815e7 commit 5c26228

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/librustc/diagnostics.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ match Some(42) {
144144
}
145145
"##,
146146

147+
E0161: r##"
148+
In Rust, you can only move a value when its size is known at compile time.
149+
150+
To work around this restriction, consider "hiding" the value behind a reference:
151+
either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move
152+
it around as usual.
153+
"##,
154+
147155
E0162: r##"
148156
An if-let pattern attempts to match the pattern, and enters the body if the
149157
match was succesful. If the match is irrefutable (when it cannot fail to match),
@@ -288,7 +296,6 @@ register_diagnostics! {
288296
E0137,
289297
E0138,
290298
E0139,
291-
E0161,
292299
E0170,
293300
E0261, // use of undeclared lifetime name
294301
E0262, // illegal lifetime parameter name

0 commit comments

Comments
 (0)