From f7ed6e18160bc8fccf27a73c05f3935c9e8f672e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 6 Feb 2019 18:02:32 +1100 Subject: [PATCH] Make an assert debug-only in `find_constraint_paths_between_regions`. This reduces instruction counts for NLL builds of `wg-grammar` by over 20%. --- .../borrow_check/nll/region_infer/error_reporting/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs index ec68ddaf3c852..550668a7ceece 100644 --- a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs +++ b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs @@ -205,7 +205,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { for constraint in self.constraint_graph .outgoing_edges(r, &self.constraints, fr_static) { - assert_eq!(constraint.sup, r); + debug_assert_eq!(constraint.sup, r); let sub_region = constraint.sub; if let Trace::NotVisited = context[sub_region] { context[sub_region] = Trace::FromOutlivesConstraint(constraint);