Skip to content

Commit f5830bb

Browse files
committed
Tidy
1 parent 19f4181 commit f5830bb

File tree

4 files changed

+37
-34
lines changed

4 files changed

+37
-34
lines changed

compiler/rustc_next_trait_solver/src/solve/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,21 @@ where
162162
}
163163
}
164164

165-
// During codegen we must assume that all feature bounds hold as we may be
166-
// monomorphizing a body from an upstream crate which had an unstable feature
167-
// enabled that we do not.
168-
//
169-
// Note: `feature_bound_holds_in_crate` does not consider a feature to be enabled
170-
// if we are in std/core even if there is a corresponding `feature` attribute on the crate.
171-
if self.cx().features().feature_bound_holds_in_crate(symbol)
172-
|| (self.typing_mode() == TypingMode::PostAnalysis) {
173-
return self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes);
174-
} else {
175-
return self.evaluate_added_goals_and_make_canonical_response(Certainty::Maybe(
176-
MaybeCause::Ambiguity,
177-
));
178-
}
179-
165+
// During codegen we must assume that all feature bounds hold as we may be
166+
// monomorphizing a body from an upstream crate which had an unstable feature
167+
// enabled that we do not.
168+
//
169+
// Note: `feature_bound_holds_in_crate` does not consider a feature to be enabled
170+
// if we are in std/core even if there is a corresponding `feature` attribute on the crate.
171+
if self.cx().features().feature_bound_holds_in_crate(symbol)
172+
|| (self.typing_mode() == TypingMode::PostAnalysis)
173+
{
174+
return self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes);
175+
} else {
176+
return self.evaluate_added_goals_and_make_canonical_response(Certainty::Maybe(
177+
MaybeCause::Ambiguity,
178+
));
179+
}
180180
}
181181

182182
#[instrument(level = "trace", skip(self))]

compiler/rustc_trait_selection/src/traits/fulfill.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -774,18 +774,20 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
774774
}
775775
}
776776

777-
// During codegen we must assume that all feature bounds hold as we may be
778-
// monomorphizing a body from an upstream crate which had an unstable feature
779-
// enabled that we do not.
780-
//
781-
// Note: we don't consider a feature to be enabled
782-
// if we are in std/core even if there is a corresponding `feature` attribute on the crate.
783-
if (!self.selcx.tcx().features().staged_api() && self.selcx.tcx().features().enabled(symbol))
784-
|| (self.selcx.infcx.typing_mode() == TypingMode::PostAnalysis) {
785-
return ProcessResult::Changed(Default::default());
786-
} else {
787-
return ProcessResult::Unchanged;
788-
}
777+
// During codegen we must assume that all feature bounds hold as we may be
778+
// monomorphizing a body from an upstream crate which had an unstable feature
779+
// enabled that we do not.
780+
//
781+
// Note: we don't consider a feature to be enabled
782+
// if we are in std/core even if there is a corresponding `feature` attribute on the crate.
783+
if (!self.selcx.tcx().features().staged_api()
784+
&& self.selcx.tcx().features().enabled(symbol))
785+
|| (self.selcx.infcx.typing_mode() == TypingMode::PostAnalysis)
786+
{
787+
return ProcessResult::Changed(Default::default());
788+
} else {
789+
return ProcessResult::Unchanged;
790+
}
789791
}
790792
},
791793
}

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -854,13 +854,14 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
854854
//
855855
// Note: we don't not consider a feature to be enabled
856856
// if we are in std/core even if there is a corresponding `feature` attribute on the crate.
857-
if (!self.tcx().features().staged_api() && self.tcx().features().enabled(symbol))
858-
|| (self.infcx.typing_mode() == TypingMode::PostAnalysis) {
859-
return Ok(EvaluatedToOk);
857+
if (!self.tcx().features().staged_api()
858+
&& self.tcx().features().enabled(symbol))
859+
|| (self.infcx.typing_mode() == TypingMode::PostAnalysis)
860+
{
861+
return Ok(EvaluatedToOk);
860862
} else {
861-
return Ok(EvaluatedToAmbig);
863+
return Ok(EvaluatedToAmbig);
862864
}
863-
864865
}
865866

866867
ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(uv)) => {

compiler/rustc_type_ir/src/flags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ impl<I: Interner> FlagComputation<I> {
409409
self.add_term(t1);
410410
self.add_term(t2);
411411
}
412-
ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(_sym))
413-
| ty::PredicateKind::Ambiguous => {}
412+
ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(_sym)) => {}
413+
ty::PredicateKind::Ambiguous => {}
414414
}
415415
}
416416

0 commit comments

Comments
 (0)