Skip to content

Commit c9843d6

Browse files
committed
remove cfg attributes
1 parent 0725d0c commit c9843d6

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ pub enum ExtraConstraintInfo {
244244
PlaceholderFromPredicate(Span),
245245
}
246246

247-
#[cfg(debug_assertions)]
248247
#[instrument(skip(infcx, sccs), level = "debug")]
249248
fn sccs_info<'cx, 'tcx>(
250249
infcx: &'cx BorrowckInferCtxt<'cx, 'tcx>,
@@ -271,10 +270,10 @@ fn sccs_info<'cx, 'tcx>(
271270
components[scc_idx.as_usize()].insert((reg_var, *origin));
272271
}
273272

274-
let mut components_str = "strongly connected components:";
273+
let mut components_str = "strongly connected components:".to_string();
275274
for (scc_idx, reg_vars_origins) in components.iter().enumerate() {
276275
let regions_info = reg_vars_origins.clone().into_iter().collect::<Vec<_>>();
277-
components_str.push(&format(
276+
components_str.push_str(&format!(
278277
"{:?}: {:?})",
279278
ConstraintSccIndex::from_usize(scc_idx),
280279
regions_info,
@@ -346,8 +345,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
346345
let fr_static = universal_regions.fr_static;
347346
let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph, fr_static));
348347

349-
#[cfg(debug_assertions)]
350-
sccs_info(_infcx, constraint_sccs.clone());
348+
if cfg!(debug_assertions) {
349+
sccs_info(_infcx, constraint_sccs.clone());
350+
}
351351

352352
let mut scc_values =
353353
RegionValues::new(elements, universal_regions.len(), &placeholder_indices);

compiler/rustc_borrowck/src/renumber.rs

-2
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,12 @@ pub(crate) enum RegionCtxt {
6262
LateBound(BoundRegionInfo),
6363
Existential(Option<Symbol>),
6464
Placeholder(BoundRegionInfo),
65-
#[cfg(debug_assertions)]
6665
Unknown,
6766
}
6867

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

compiler/rustc_infer/src/infer/canonical/query_response.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,7 @@ impl<'tcx> InferCtxt<'tcx> {
318318

319319
// Screen out `'a: 'a` cases.
320320
let ty::OutlivesPredicate(k1, r2) = r_c.0;
321-
if k1 != r2.into() {
322-
Some(r_c)
323-
} else {
324-
None
325-
}
321+
if k1 != r2.into() { Some(r_c) } else { None }
326322
}),
327323
);
328324

0 commit comments

Comments
 (0)