add -Z flag
This commit is contained in:
parent
3009b2c647
commit
a2050ba12d
@ -1436,6 +1436,8 @@ options! {
|
||||
"output statistics about monomorphization collection"),
|
||||
dump_mono_stats_format: DumpMonoStatsFormat = (DumpMonoStatsFormat::Markdown, parse_dump_mono_stats, [UNTRACKED],
|
||||
"the format to use for -Z dump-mono-stats (`markdown` (default) or `json`)"),
|
||||
dump_solver_proof_tree: bool = (false, parse_bool, [UNTRACKED],
|
||||
"dump a proof tree for every goal evaluated by the new trait solver"),
|
||||
dwarf_version: Option<u32> = (None, parse_opt_number, [TRACKED],
|
||||
"version of DWARF debug information to emit (default: 2 or 4, depending on platform)"),
|
||||
dylib_lto: bool = (false, parse_bool, [UNTRACKED],
|
||||
|
@ -147,13 +147,21 @@ impl<'tcx> InferCtxtEvalExt<'tcx> for InferCtxt<'tcx> {
|
||||
var_values: CanonicalVarValues::dummy(),
|
||||
nested_goals: NestedGoals::new(),
|
||||
tainted: Ok(()),
|
||||
inspect: Box::new(DebugSolver::new()),
|
||||
inspect: match self.tcx.sess.opts.unstable_opts.dump_solver_proof_tree {
|
||||
true => Box::new(DebugSolver::new()),
|
||||
false => Box::new(()),
|
||||
},
|
||||
};
|
||||
let result = ecx.evaluate_goal(IsNormalizesToHack::No, goal);
|
||||
|
||||
let tree = match ecx.inspect.into_debug_solver() {
|
||||
let tcx = ecx.tcx();
|
||||
match ecx.inspect.into_debug_solver() {
|
||||
Some(tree) => match Box::leak(tree) {
|
||||
DebugSolver::GoalEvaluation(tree) => tree,
|
||||
DebugSolver::GoalEvaluation(tree) => {
|
||||
if tcx.sess.opts.unstable_opts.dump_solver_proof_tree {
|
||||
println!("{:?}", tree);
|
||||
}
|
||||
}
|
||||
_ => unreachable!("unable to convert to `DebugSolver::GoalEvaluation`"),
|
||||
},
|
||||
_ => unreachable!("unable to convert to `DebugSolver::GoalEvaluation`"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user