Skip to content

Commit f2d2a4a

Browse files
committed
Don't downgrade NLL borrowck errors ignored by AST to warnings in migrate mode
1 parent c2e49bf commit f2d2a4a

File tree

1 file changed

+13
-13
lines changed
  • src/librustc_mir/borrow_check

1 file changed

+13
-13
lines changed

src/librustc_mir/borrow_check/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc::mir::{Terminator, TerminatorKind};
1717
use rustc::ty::query::Providers;
1818
use rustc::ty::{self, TyCtxt};
1919

20-
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, Level};
20+
use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder};
2121
use rustc_data_structures::bit_set::BitSet;
2222
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
2323
use rustc_data_structures::graph::dominators::Dominators;
@@ -433,18 +433,18 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
433433
result
434434
}
435435

436-
fn downgrade_if_error(diag: &mut Diagnostic) {
437-
if diag.is_error() {
438-
diag.level = Level::Warning;
439-
diag.warn(
440-
"this error has been downgraded to a warning for backwards \
441-
compatibility with previous releases",
442-
);
443-
diag.warn(
444-
"this represents potential undefined behavior in your code and \
445-
this warning will become a hard error in the future",
446-
);
447-
}
436+
fn downgrade_if_error(_diag: &mut Diagnostic) {
437+
// if diag.is_error() {
438+
// diag.level = Level::Warning;
439+
// diag.warn(
440+
// "this error has been downgraded to a warning for backwards \
441+
// compatibility with previous releases",
442+
// );
443+
// diag.warn(
444+
// "this represents potential undefined behavior in your code and \
445+
// this warning will become a hard error in the future",
446+
// );
447+
// }
448448
}
449449

450450
pub struct MirBorrowckCtxt<'cx, 'gcx: 'tcx, 'tcx: 'cx> {

0 commit comments

Comments
 (0)