@@ -5,7 +5,7 @@ use std::{cmp, collections::HashMap, convert::Infallible, mem};
5
5
use chalk_ir:: {
6
6
cast:: Cast ,
7
7
fold:: { FallibleTypeFolder , TypeFoldable } ,
8
- AliasEq , AliasTy , BoundVar , ConstData , DebruijnIndex , FnSubst , Mutability , TyKind , WhereClause ,
8
+ AliasEq , AliasTy , BoundVar , DebruijnIndex , FnSubst , Mutability , TyKind , WhereClause ,
9
9
} ;
10
10
use hir_def:: {
11
11
data:: adt:: VariantData ,
@@ -26,8 +26,8 @@ use crate::{
26
26
static_lifetime, to_chalk_trait_id,
27
27
traits:: FnTrait ,
28
28
utils:: { self , generics, Generics } ,
29
- Adjust , Adjustment , Binders , BindingMode , ChalkTraitId , ClosureId , ConstValue , DynTy ,
30
- FnPointer , FnSig , Interner , Substitution , Ty , TyExt ,
29
+ Adjust , Adjustment , Binders , BindingMode , ChalkTraitId , ClosureId , DynTy , FnPointer , FnSig ,
30
+ Interner , Substitution , Ty , TyExt ,
31
31
} ;
32
32
33
33
use super :: { Expectation , InferenceContext } ;
@@ -266,24 +266,19 @@ impl CapturedItemWithoutTy {
266
266
let Some ( idx) = self . generics . param_idx ( x) else {
267
267
return Err ( ( ) ) ;
268
268
} ;
269
- Ok ( ConstData {
270
- ty,
271
- value : ConstValue :: BoundVar ( BoundVar :: new ( outer_binder, idx) ) ,
272
- }
273
- . intern ( Interner ) )
269
+ Ok ( BoundVar :: new ( outer_binder, idx) . to_const ( Interner , ty) )
274
270
}
275
271
276
272
fn try_fold_free_placeholder_ty (
277
273
& mut self ,
278
274
idx : chalk_ir:: PlaceholderIndex ,
279
- _outer_binder : DebruijnIndex ,
275
+ outer_binder : DebruijnIndex ,
280
276
) -> std:: result:: Result < Ty , Self :: Error > {
281
277
let x = from_placeholder_idx ( self . db , idx) ;
282
278
let Some ( idx) = self . generics . param_idx ( x) else {
283
279
return Err ( ( ) ) ;
284
280
} ;
285
- Ok ( TyKind :: BoundVar ( BoundVar :: new ( DebruijnIndex :: INNERMOST , idx) )
286
- . intern ( Interner ) )
281
+ Ok ( BoundVar :: new ( outer_binder, idx) . to_ty ( Interner ) )
287
282
}
288
283
}
289
284
let g_def = match owner {
0 commit comments