File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
compiler/rustc_trait_selection/src/solve
tests/ui/traits/new-solver/alias-relate Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
352352 let & ty:: Alias ( _, projection_ty) = goal. predicate . self_ty ( ) . kind ( ) else { return } ;
353353
354354 candidates. extend ( self . probe ( |_| ProbeKind :: NormalizedSelfTyAssembly ) . enter ( |ecx| {
355- if num_steps < ecx . local_overflow_limit ( ) {
355+ if tcx . recursion_limit ( ) . value_within_limit ( num_steps ) {
356356 let normalized_ty = ecx. next_ty_infer ( ) ;
357357 let normalizes_to_goal = goal. with (
358358 tcx,
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
310310 depth : usize ,
311311 ty : Ty < ' tcx > ,
312312 ) -> Option < Ty < ' tcx > > {
313- if depth >= self . local_overflow_limit ( ) {
313+ if ! self . tcx ( ) . recursion_limit ( ) . value_within_limit ( depth ) {
314314 return None ;
315315 }
316316
Original file line number Diff line number Diff line change 1+ // check-pass
2+ // compile-flags: -Ztrait-solver=next
3+ // regression test for trait-system-refactor-initiative#68
4+ trait Identity {
5+ type Assoc : ?Sized ;
6+ }
7+
8+ impl < T : ?Sized > Identity for T {
9+ type Assoc = T ;
10+ }
11+
12+ type Id < T > = <T as Identity >:: Assoc ;
13+
14+ type Five < T > = Id < Id < Id < Id < Id < T > > > > > ;
15+ type Ty < T > = Five < Five < Five < Five < Five < T > > > > > ;
16+
17+ trait Trait < T > { }
18+
19+ impl < T > Trait < T > for Ty < T > { }
20+ impl Trait < u32 > for Ty < i32 > { }
21+
22+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments