useful for profiling / PGO."),
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
"choose which RELRO level to use"),
+ nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
+ "when tracking region error causes, accept subminimal results for faster execution."),
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],
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc::mir::{BasicBlock, Location, Mir};
-use rustc::ty::RegionVid;
+use rustc::ty::{self, RegionVid};
use syntax::codemap::Span;
use super::{Cause, CauseExt, TrackCauses};
if let Some(causes) = &mut self.causes {
let cause = make_cause(causes);
let old_cause = causes.get_mut(&(r, i)).unwrap();
- if cause < **old_cause {
+ // #49998: compare using root cause alone to avoid
+ // useless traffic from similar outlives chains.
+
+ let overwrite = if ty::tls::with(|tcx| {
+ tcx.sess.opts.debugging_opts.nll_subminimal_causes
+ }) {
+ cause.root_cause() < old_cause.root_cause()
+ } else {
+ cause < **old_cause
+ };
+ if overwrite {
*old_cause = Rc::new(cause);
return true;
}