Skip to content

Commit

Permalink
Update E0301 to the new format
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofgarczynski committed Aug 12, 2016
1 parent f55ac69 commit 302a423
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_const_eval/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {}
}
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0301.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fn main() {
match Some(()) {
None => { },
option if option.take().is_none() => {}, //~ ERROR E0301
//~| NOTE borrowed mutably in pattern guard
Some(_) => { }
}
}

0 comments on commit 302a423

Please sign in to comment.