Skip to content

Commit 56af56a

Browse files
pretty pretty formatting
1 parent 6247365 commit 56af56a

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+19-12
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,25 @@ pub enum ProcessResult<O, E> {
146146
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
147147
struct ObligationTreeId(usize);
148148

149-
type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
149+
use uwu::*;
150+
151+
mod uwu {
152+
use super::*;
153+
pub type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
154+
155+
impl<O: ForestObligation> ObligationForest<O> {
156+
pub fn new() -> ObligationForest<O> {
157+
ObligationForest {
158+
nodes: vec![],
159+
done_cache: Default::default(),
160+
active_cache: Default::default(),
161+
reused_node_vec: vec![],
162+
obligation_tree_id_generator: (0..).map(ObligationTreeId),
163+
error_cache: Default::default(),
164+
}
165+
}
166+
}
167+
}
150168

151169
pub struct ObligationForest<O: ForestObligation> {
152170
/// The list of obligations. In between calls to [Self::process_obligations],
@@ -311,17 +329,6 @@ pub struct Error<O, E> {
311329
}
312330

313331
impl<O: ForestObligation> ObligationForest<O> {
314-
pub fn new() -> ObligationForest<O> {
315-
ObligationForest {
316-
nodes: vec![],
317-
done_cache: Default::default(),
318-
active_cache: Default::default(),
319-
reused_node_vec: vec![],
320-
obligation_tree_id_generator: (0..).map(ObligationTreeId),
321-
error_cache: Default::default(),
322-
}
323-
}
324-
325332
/// Returns the total number of nodes in the forest that have not
326333
/// yet been fully resolved.
327334
pub fn len(&self) -> usize {

compiler/rustc_trait_selection/src/solve/assembly/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,16 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
846846
if let Some(result) = self.try_merge_responses(&responses) {
847847
return Ok(result);
848848
} else {
849-
let param_env_candidates = candidates.iter().filter(|c| matches!(c.source, CandidateSource::ParamEnv(_))).map(|c| c.result).collect::<Vec<_>>();
849+
let param_env_candidates = candidates
850+
.iter()
851+
.filter(|c| matches!(c.source, CandidateSource::ParamEnv(_)))
852+
.map(|c| c.result)
853+
.collect::<Vec<_>>();
850854
if let Some(result) = self.try_merge_responses(&param_env_candidates) {
851855
return Ok(result);
852856
} else {
853857
self.flounder(&responses)
854858
}
855-
}
859+
}
856860
}
857861
}

compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use rustc_infer::infer::canonical::query_response::make_query_region_constraints
1919
use rustc_infer::infer::canonical::CanonicalVarValues;
2020
use rustc_infer::infer::canonical::{CanonicalExt, QueryRegionConstraints};
2121
use rustc_infer::infer::resolve::EagerResolver;
22+
use rustc_infer::infer::InferCtxt;
2223
use rustc_infer::infer::RegionVariableOrigin;
23-
use rustc_infer::infer::{InferCtxt,};
2424
use rustc_infer::traits::solve::NestedNormalizationGoals;
2525
use rustc_middle::infer::canonical::Canonical;
2626
use rustc_middle::traits::query::NoSolution;

compiler/rustc_trait_selection/src/traits/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,12 @@ pub fn normalize_param_env_or_error<'tcx>(
395395
let infcx = tcx.infer_ctxt().build();
396396
let ocx = ObligationCtxt::new(&infcx);
397397
let param_env = ty::ParamEnv::empty();
398-
ocx.register_obligation(Obligation::new(tcx, ObligationCause::dummy(), param_env, p));
398+
ocx.register_obligation(Obligation::new(
399+
tcx,
400+
ObligationCause::dummy(),
401+
param_env,
402+
p,
403+
));
399404
if !ocx.select_all_or_error().is_empty() {
400405
true
401406
} else if ocx.resolve_regions(&OutlivesEnvironment::new(param_env)).is_empty() {

0 commit comments

Comments
 (0)