Rollup merge of #35644 - garekkream:update-E0302-new-error-format, r=jonathandturner
Update E0302 to the new format Part of #35233. Fixes #35523. r? @jonathandturner
This commit is contained in:
commit
50aa568709
@ -1187,7 +1187,9 @@ fn decl_without_init(&mut self, _: NodeId, _: Span) {}
|
||||
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