Update E0303 to new error format
This commit is contained in:
parent
9d4d0da7af
commit
9d364267d6
@ -1238,8 +1238,10 @@ impl<'a, 'b, 'tcx, 'v> Visitor<'v> for AtBindingPatternVisitor<'a, 'b, 'tcx> {
|
||||
match pat.node {
|
||||
PatKind::Binding(.., ref subpat) => {
|
||||
if !self.bindings_allowed {
|
||||
span_err!(self.cx.tcx.sess, pat.span, E0303,
|
||||
"pattern bindings are not allowed after an `@`");
|
||||
struct_span_err!(self.cx.tcx.sess, pat.span, E0303,
|
||||
"pattern bindings are not allowed after an `@`")
|
||||
.span_label(pat.span, &format!("not allowed after `@`"))
|
||||
.emit();
|
||||
}
|
||||
|
||||
if subpat.is_some() {
|
||||
|
@ -15,6 +15,7 @@ fn main() {
|
||||
//~^ ERROR E0007
|
||||
//~| NOTE binds an already bound by-move value by moving it
|
||||
//~| ERROR E0303
|
||||
//~| NOTE not allowed after `@`
|
||||
None => {},
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,12 @@
|
||||
|
||||
fn main() {
|
||||
match Some("hi".to_string()) {
|
||||
ref op_string_ref @ Some(s) => {}, //~ ERROR E0303
|
||||
//~^ ERROR E0009
|
||||
ref op_string_ref @ Some(s) => {},
|
||||
//~^ ERROR pattern bindings are not allowed after an `@` [E0303]
|
||||
//~| NOTE not allowed after `@`
|
||||
//~| ERROR E0009
|
||||
//~| NOTE by-move pattern here
|
||||
//~| NOTE both by-ref and by-move used
|
||||
None => {},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user