Skip to content

Commit

Permalink
Added flag to disable user type assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtwco committed Mar 22, 2018
1 parent 04aeef8 commit 447ae76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc/session/config.rs
Expand Up @@ -1251,6 +1251,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"choose which RELRO level to use"),
nll: bool = (false, parse_bool, [UNTRACKED],
"run the non-lexical lifetimes MIR pass"),
disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
"disable user provided type assertion in NLL"),
trans_time_graph: bool = (false, parse_bool, [UNTRACKED],
"generate a graphical HTML report of time spent in trans and LLVM"),
thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_mir/build/matches/mod.rs
Expand Up @@ -147,6 +147,8 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {

pub fn user_assert_ty(&mut self, block: BasicBlock, hir_id: hir::HirId,
var: NodeId, span: Span) {
if self.hir.tcx().sess.opts.debugging_opts.disable_nll_user_type_assert { return; }

let local_id = self.var_indices[&var];
let source_info = self.source_info(span);

Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/generator/yield-subtype.rs
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

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

#![feature(generators)]
Expand Down

0 comments on commit 447ae76

Please sign in to comment.