1
Fork 0

remove cfg attributes

This commit is contained in:
b-naber 2023-02-20 21:57:03 +00:00
parent 0725d0ceee
commit c9843d6144
3 changed files with 6 additions and 12 deletions

View file

@ -244,7 +244,6 @@ pub enum ExtraConstraintInfo {
PlaceholderFromPredicate(Span), PlaceholderFromPredicate(Span),
} }
#[cfg(debug_assertions)]
#[instrument(skip(infcx, sccs), level = "debug")] #[instrument(skip(infcx, sccs), level = "debug")]
fn sccs_info<'cx, 'tcx>( fn sccs_info<'cx, 'tcx>(
infcx: &'cx BorrowckInferCtxt<'cx, 'tcx>, infcx: &'cx BorrowckInferCtxt<'cx, 'tcx>,
@ -271,10 +270,10 @@ fn sccs_info<'cx, 'tcx>(
components[scc_idx.as_usize()].insert((reg_var, *origin)); components[scc_idx.as_usize()].insert((reg_var, *origin));
} }
let mut components_str = "strongly connected components:"; let mut components_str = "strongly connected components:".to_string();
for (scc_idx, reg_vars_origins) in components.iter().enumerate() { for (scc_idx, reg_vars_origins) in components.iter().enumerate() {
let regions_info = reg_vars_origins.clone().into_iter().collect::<Vec<_>>(); let regions_info = reg_vars_origins.clone().into_iter().collect::<Vec<_>>();
components_str.push(&format( components_str.push_str(&format!(
"{:?}: {:?})", "{:?}: {:?})",
ConstraintSccIndex::from_usize(scc_idx), ConstraintSccIndex::from_usize(scc_idx),
regions_info, regions_info,
@ -346,8 +345,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
let fr_static = universal_regions.fr_static; let fr_static = universal_regions.fr_static;
let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph, fr_static)); let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph, fr_static));
#[cfg(debug_assertions)] if cfg!(debug_assertions) {
sccs_info(_infcx, constraint_sccs.clone()); sccs_info(_infcx, constraint_sccs.clone());
}
let mut scc_values = let mut scc_values =
RegionValues::new(elements, universal_regions.len(), &placeholder_indices); RegionValues::new(elements, universal_regions.len(), &placeholder_indices);

View file

@ -62,14 +62,12 @@ pub(crate) enum RegionCtxt {
LateBound(BoundRegionInfo), LateBound(BoundRegionInfo),
Existential(Option<Symbol>), Existential(Option<Symbol>),
Placeholder(BoundRegionInfo), Placeholder(BoundRegionInfo),
#[cfg(debug_assertions)]
Unknown, Unknown,
} }
impl RegionCtxt { impl RegionCtxt {
/// Used to determine the representative of a component in the strongly connected /// Used to determine the representative of a component in the strongly connected
/// constraint graph /// constraint graph
#[cfg(debug_assertions)]
pub(crate) fn preference_value(self) -> usize { pub(crate) fn preference_value(self) -> usize {
let _anon = Symbol::intern("anon"); let _anon = Symbol::intern("anon");

View file

@ -318,11 +318,7 @@ impl<'tcx> InferCtxt<'tcx> {
// Screen out `'a: 'a` cases. // Screen out `'a: 'a` cases.
let ty::OutlivesPredicate(k1, r2) = r_c.0; let ty::OutlivesPredicate(k1, r2) = r_c.0;
if k1 != r2.into() { if k1 != r2.into() { Some(r_c) } else { None }
Some(r_c)
} else {
None
}
}), }),
); );