diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 70f6a323e88..4a5abb05149 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -97,6 +97,7 @@ use place_ext::PlaceExt; use places_conflict::{places_conflict, PlaceConflictBias}; use region_infer::RegionInferenceContext; +#[cfg(debug_assertions)] use renumber::RegionCtxt; // FIXME(eddyb) perhaps move this somewhere more centrally. diff --git a/compiler/rustc_borrowck/src/nll.rs b/compiler/rustc_borrowck/src/nll.rs index 28d49c19c75..e5dbb83dd07 100644 --- a/compiler/rustc_borrowck/src/nll.rs +++ b/compiler/rustc_borrowck/src/nll.rs @@ -257,11 +257,6 @@ pub(crate) fn compute_regions<'cx, 'tcx>( borrow_set, ); - if cfg!(debug_assertions) { - let var_to_origin = infcx.reg_var_to_origin.borrow(); - debug!("var_to_origin: {:#?}", var_to_origin); - } - let mut regioncx = RegionInferenceContext::new( infcx, var_origins, diff --git a/compiler/rustc_borrowck/src/renumber.rs b/compiler/rustc_borrowck/src/renumber.rs index eeba0e3c2bc..cf0b944a4c5 100644 --- a/compiler/rustc_borrowck/src/renumber.rs +++ b/compiler/rustc_borrowck/src/renumber.rs @@ -8,6 +8,7 @@ use rustc_middle::mir::{Body, Location, Promoted}; use rustc_middle::ty::subst::SubstsRef; use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable}; +#[cfg(debug_assertions)] use rustc_span::Symbol; /// Replaces all free regions appearing in the MIR with fresh diff --git a/compiler/rustc_borrowck/src/type_check/relate_tys.rs b/compiler/rustc_borrowck/src/type_check/relate_tys.rs index 91b26fc4e53..bb05349b2e9 100644 --- a/compiler/rustc_borrowck/src/type_check/relate_tys.rs +++ b/compiler/rustc_borrowck/src/type_check/relate_tys.rs @@ -9,6 +9,7 @@ use crate::constraints::OutlivesConstraint; use crate::diagnostics::UniverseInfo; +#[cfg(debug_assertions)] use crate::renumber::RegionCtxt; use crate::type_check::{InstantiateOpaqueType, Locations, TypeChecker}; diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs index 919c772a203..e22b9de6fc1 100644 --- a/compiler/rustc_borrowck/src/universal_regions.rs +++ b/compiler/rustc_borrowck/src/universal_regions.rs @@ -26,10 +26,12 @@ self, DefIdTree, InlineConstSubsts, InlineConstSubstsParts, RegionVid, Ty, TyCtxt, }; use rustc_middle::ty::{InternalSubsts, SubstsRef}; +#[cfg(debug_assertions)] use rustc_span::Symbol; use std::iter; use crate::nll::ToRegionVid; +#[cfg(debug_assertions)] use crate::renumber::RegionCtxt; use crate::BorrowckInferCtxt;