Added flag to disable user type assertion.

This commit is contained in:
David Wood 2018-03-22 22:48:39 +00:00
parent 04aeef8d45
commit 447ae7612a
No known key found for this signature in database
GPG key ID: 01760B4F9F53F154
3 changed files with 5 additions and 0 deletions

View file

@ -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],

View file

@ -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);

View file

@ -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)]