File tree Expand file tree Collapse file tree
compiler/rustc_next_trait_solver/src/solve/eval_ctxt
tests/ui/traits/next-solver/cycles/coinduction Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
13411311Ok ( canonical)
13421312}
13431313
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ error[E0275]: overflow evaluating the requirement `W<_>: Trait`
44LL | impls::<W<_>>();
55 | ^^^^
66 |
7- = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`fixpoint_exponential_growth`)
87note: required by a bound in `impls`
98 --> $DIR/fixpoint-exponential-growth.rs:30:13
109 |
You can’t perform that action at this time.
0 commit comments