mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 05:56:56 +00:00
Update E0007 to new format
This commit is contained in:
parent
0cb8439aa3
commit
aa40ec7f11
@ -1112,7 +1112,10 @@ fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
|
||||
|
||||
// x @ Foo(..) is legal, but x @ Foo(y) isn't.
|
||||
if sub.map_or(false, |p| pat_contains_bindings(&p)) {
|
||||
span_err!(cx.tcx.sess, p.span, E0007, "cannot bind by-move with sub-bindings");
|
||||
struct_span_err!(cx.tcx.sess, p.span, E0007,
|
||||
"cannot bind by-move with sub-bindings")
|
||||
.span_label(p.span, &format!("binds an already bound by-move value by moving it"))
|
||||
.emit();
|
||||
} else if has_guard {
|
||||
struct_span_err!(cx.tcx.sess, p.span, E0008,
|
||||
"cannot bind by-move into a pattern guard")
|
||||
|
@ -11,8 +11,10 @@
|
||||
fn main() {
|
||||
let x = Some("s".to_string());
|
||||
match x {
|
||||
op_string @ Some(s) => {}, //~ ERROR E0007
|
||||
//~| ERROR E0303
|
||||
op_string @ Some(s) => {},
|
||||
//~^ ERROR E0007
|
||||
//~| NOTE binds an already bound by-move value by moving it
|
||||
//~| ERROR E0303
|
||||
None => {},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user