Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prep work for using timely dataflow with NLL #49836

Merged
merged 16 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,28 +303,28 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
) {
debug!("report_region_errors(): {} errors to start", errors.len());

if will_later_be_reported_by_nll && self.tcx.nll() {
if will_later_be_reported_by_nll && self.tcx.use_mir_borrowck() {
// With `#![feature(nll)]`, we want to present a nice user
// experience, so don't even mention the errors from the
// AST checker.
if self.tcx.features().nll {
return;
}

// But with -Znll, it's nice to have some note for later.
// But with nll, it's nice to have some note for later.
for error in errors {
match *error {
RegionResolutionError::ConcreteFailure(ref origin, ..)
| RegionResolutionError::GenericBoundFailure(ref origin, ..) => {
self.tcx
.sess
.span_warn(origin.span(), "not reporting region error due to -Znll");
.span_warn(origin.span(), "not reporting region error due to nll");
}

RegionResolutionError::SubSupConflict(ref rvo, ..) => {
self.tcx
.sess
.span_warn(rvo.span(), "not reporting region error due to -Znll");
.span_warn(rvo.span(), "not reporting region error due to nll");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ impl Location {
Location { block: self.block, statement_index: self.statement_index + 1 }
}

pub fn dominates(&self, other: &Location, dominators: &Dominators<BasicBlock>) -> bool {
pub fn dominates(&self, other: Location, dominators: &Dominators<BasicBlock>) -> bool {
if self.block == other.block {
self.statement_index <= other.statement_index
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
useful for profiling / PGO."),
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
"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],
Expand Down
14 changes: 3 additions & 11 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1471,15 +1471,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
self.on_disk_query_result_cache.serialize(self.global_tcx(), encoder)
}

/// If true, we should use NLL-style region checking instead of
/// lexical style.
pub fn nll(self) -> bool {
self.features().nll || self.sess.opts.debugging_opts.nll
}

/// If true, we should use the MIR-based borrowck (we may *also* use
/// the AST-based borrowck).
pub fn use_mir(self) -> bool {
pub fn use_mir_borrowck(self) -> bool {
self.borrowck_mode().use_mir()
}

Expand All @@ -1498,7 +1492,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
mode @ BorrowckMode::Compare => mode,

mode @ BorrowckMode::Ast => {
if self.nll() {
if self.features().nll {
BorrowckMode::Mir
} else {
mode
Expand All @@ -1512,11 +1506,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
/// MIR borrowck, but not when NLL is used. They are also consumed
/// by the validation stuff.
pub fn emit_end_regions(self) -> bool {
// FIXME(#46875) -- we should not emit end regions when NLL is enabled,
// but for now we can't stop doing so because it causes false positives
self.sess.opts.debugging_opts.emit_end_regions ||
self.sess.opts.debugging_opts.mir_emit_validate > 0 ||
self.use_mir()
self.use_mir_borrowck()
}

#[inline]
Expand Down
Loading