Update E0301 to the new format

This commit is contained in:
Krzysztof Garczynski 2016-08-13 01:33:42 +02:00
parent f55ac6944a
commit 302a423047
2 changed files with 4 additions and 1 deletions

View File

@ -1175,8 +1175,10 @@ fn borrow(&mut self,
_: 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 => {}
}

View File

@ -12,6 +12,7 @@ fn main() {
match Some(()) {
None => { },
option if option.take().is_none() => {}, //~ ERROR E0301
//~| NOTE borrowed mutably in pattern guard
Some(_) => { }
}
}