Skip to content

Commit cc63a0a

Browse files
committed
Auto merge of rust-lang#148066 - lcnr:remove-perf-hack, r=BoxyUwU
remove a performance hack This hack seems no longer used 🤔 nalgebra compiles without it. Let's run perf to see whether it matters. r? `@BoxyUwU`
2 parents 34f954f + 561e3ce commit cc63a0a

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,36 +1308,6 @@ where
13081308
},
13091309
);
13101310

1311-
// HACK: We bail with overflow if the response would have too many non-region
1312-
// inference variables. This tends to only happen if we encounter a lot of
1313-
// ambiguous alias types which get replaced with fresh inference variables
1314-
// during generalization. This prevents hangs caused by an exponential blowup,
1315-
// see tests/ui/traits/next-solver/coherence-alias-hang.rs.
1316-
match self.current_goal_kind {
1317-
// We don't do so for `NormalizesTo` goals as we erased the expected term and
1318-
// bailing with overflow here would prevent us from detecting a type-mismatch,
1319-
// causing a coherence error in diesel, see #131969. We still bail with overflow
1320-
// when later returning from the parent AliasRelate goal.
1321-
CurrentGoalKind::NormalizesTo => {}
1322-
CurrentGoalKind::Misc | CurrentGoalKind::CoinductiveTrait => {
1323-
let num_non_region_vars = canonical
1324-
.variables
1325-
.iter()
1326-
.filter(|c| !c.is_region() && c.is_existential())
1327-
.count();
1328-
if num_non_region_vars > self.cx().recursion_limit() {
1329-
debug!(?num_non_region_vars, "too many inference variables -> overflow");
1330-
return Ok(self.make_ambiguous_response_no_constraints(
1331-
MaybeCause::Overflow {
1332-
suggest_increasing_limit: true,
1333-
keep_constraints: false,
1334-
},
1335-
OpaqueTypesJank::AllGood,
1336-
));
1337-
}
1338-
}
1339-
}
1340-
13411311
Ok(canonical)
13421312
}
13431313

tests/ui/traits/next-solver/cycles/coinduction/fixpoint-exponential-growth.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ error[E0275]: overflow evaluating the requirement `W<_>: Trait`
44
LL | impls::<W<_>>();
55
| ^^^^
66
|
7-
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`fixpoint_exponential_growth`)
87
note: required by a bound in `impls`
98
--> $DIR/fixpoint-exponential-growth.rs:30:13
109
|

0 commit comments

Comments
 (0)