Skip to content

Commit

Permalink
remove cfg attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Feb 20, 2023
1 parent 0725d0c commit c9843d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
10 changes: 5 additions & 5 deletions compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ pub enum ExtraConstraintInfo {
PlaceholderFromPredicate(Span),
}

#[cfg(debug_assertions)]
#[instrument(skip(infcx, sccs), level = "debug")]
fn sccs_info<'cx, 'tcx>(
infcx: &'cx BorrowckInferCtxt<'cx, 'tcx>,
Expand All @@ -271,10 +270,10 @@ fn sccs_info<'cx, 'tcx>(
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() {
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),
regions_info,
Expand Down Expand Up @@ -346,8 +345,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
let fr_static = universal_regions.fr_static;
let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph, fr_static));

#[cfg(debug_assertions)]
sccs_info(_infcx, constraint_sccs.clone());
if cfg!(debug_assertions) {
sccs_info(_infcx, constraint_sccs.clone());
}

let mut scc_values =
RegionValues::new(elements, universal_regions.len(), &placeholder_indices);
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_borrowck/src/renumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ pub(crate) enum RegionCtxt {
LateBound(BoundRegionInfo),
Existential(Option<Symbol>),
Placeholder(BoundRegionInfo),
#[cfg(debug_assertions)]
Unknown,
}

impl RegionCtxt {
/// Used to determine the representative of a component in the strongly connected
/// constraint graph
#[cfg(debug_assertions)]
pub(crate) fn preference_value(self) -> usize {
let _anon = Symbol::intern("anon");

Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_infer/src/infer/canonical/query_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,7 @@ impl<'tcx> InferCtxt<'tcx> {

// Screen out `'a: 'a` cases.
let ty::OutlivesPredicate(k1, r2) = r_c.0;
if k1 != r2.into() {
Some(r_c)
} else {
None
}
if k1 != r2.into() { Some(r_c) } else { None }
}),
);

Expand Down

0 comments on commit c9843d6

Please sign in to comment.