Rollup merge of #35643 - garekkream:update-E0301-new-error-format, r=jonathandturner
Update E0301 to the new format Part of #35233. Fixes #35522. r? @jonathandturner
This commit is contained in:
commit
f91d242ad6
@ -1175,8 +1175,10 @@ impl<'a, 'gcx, 'tcx> Delegate<'tcx> for MutationChecker<'a, 'gcx> {
|
||||
_: LoanCause) {
|
||||
match kind {
|
||||
MutBorrow => {
|
||||
span_err!(self.cx.tcx.sess, span, E0301,
|
||||
struct_span_err!(self.cx.tcx.sess, span, E0301,
|
||||
"cannot mutably borrow in a pattern guard")
|
||||
.span_label(span, &format!("borrowed mutably in pattern guard"))
|
||||
.emit();
|
||||
}
|
||||
ImmBorrow | UniqueImmBorrow => {}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ fn main() {
|
||||
match Some(()) {
|
||||
None => { },
|
||||
option if option.take().is_none() => {}, //~ ERROR E0301
|
||||
//~| NOTE borrowed mutably in pattern guard
|
||||
Some(_) => { }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user