mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
Update E0302 to the new format
This commit is contained in:
parent
f55ac6944a
commit
5402d28fe7
@ -1185,7 +1185,9 @@ impl<'a, 'gcx, 'tcx> Delegate<'tcx> for MutationChecker<'a, 'gcx> {
|
||||
fn mutate(&mut self, _: NodeId, span: Span, _: cmt, mode: MutateMode) {
|
||||
match mode {
|
||||
MutateMode::JustWrite | MutateMode::WriteAndRead => {
|
||||
span_err!(self.cx.tcx.sess, span, E0302, "cannot assign in a pattern guard")
|
||||
struct_span_err!(self.cx.tcx.sess, span, E0302, "cannot assign in a pattern guard")
|
||||
.span_label(span, &format!("assignment in pattern guard"))
|
||||
.emit();
|
||||
}
|
||||
MutateMode::Init => {}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ fn main() {
|
||||
match Some(()) {
|
||||
None => { },
|
||||
option if { option = None; false } => { }, //~ ERROR E0302
|
||||
//~| NOTE assignment in pattern guard
|
||||
Some(_) => { }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user