Skip to content

Commit 447ae76

Browse files
committed
Added flag to disable user type assertion.
1 parent 04aeef8 commit 447ae76

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/librustc/session/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
12511251
"choose which RELRO level to use"),
12521252
nll: bool = (false, parse_bool, [UNTRACKED],
12531253
"run the non-lexical lifetimes MIR pass"),
1254+
disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
1255+
"disable user provided type assertion in NLL"),
12541256
trans_time_graph: bool = (false, parse_bool, [UNTRACKED],
12551257
"generate a graphical HTML report of time spent in trans and LLVM"),
12561258
thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],

src/librustc_mir/build/matches/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
147147

148148
pub fn user_assert_ty(&mut self, block: BasicBlock, hir_id: hir::HirId,
149149
var: NodeId, span: Span) {
150+
if self.hir.tcx().sess.opts.debugging_opts.disable_nll_user_type_assert { return; }
151+
150152
let local_id = self.var_indices[&var];
151153
let source_info = self.source_info(span);
152154

src/test/run-pass/generator/yield-subtype.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// revisions:lexical nll
12+
//[nll]compile-flags: -Z disable-nll-user-type-assert
1213
#![cfg_attr(nll, feature(nll))]
1314

1415
#![feature(generators)]

0 commit comments

Comments
 (0)