@@ -18,15 +18,18 @@ use ra_ap_hir_def::{
18
18
} ;
19
19
use ra_ap_hir_def:: { HasModule , visibility:: VisibilityExplicitness } ;
20
20
use ra_ap_hir_def:: { ModuleId , resolver:: HasResolver } ;
21
- use ra_ap_hir_ty:: TraitRefExt ;
22
21
use ra_ap_hir_ty:: Ty ;
23
22
use ra_ap_hir_ty:: TyExt ;
24
23
use ra_ap_hir_ty:: WhereClause ;
25
24
use ra_ap_hir_ty:: { Binders , FnPointer } ;
26
25
use ra_ap_hir_ty:: { Interner , ProjectionTy } ;
26
+ use ra_ap_hir_ty:: { TraitRefExt , from_assoc_type_id} ;
27
27
use ra_ap_ide_db:: RootDatabase ;
28
28
use ra_ap_vfs:: { Vfs , VfsPath } ;
29
29
30
+ use ra_ap_hir_def:: data:: ConstFlags ;
31
+ use ra_ap_hir_def:: item_tree:: StaticFlags ;
32
+ use ra_ap_hir_ty:: db:: InternedCallableDefId ;
30
33
use std:: hash:: Hasher ;
31
34
use std:: { cmp:: Ordering , collections:: HashMap , path:: PathBuf } ;
32
35
use std:: { hash:: Hash , vec} ;
@@ -374,7 +377,7 @@ fn emit_const(
374
377
attrs : vec ! [ ] ,
375
378
body : None ,
376
379
is_const : true ,
377
- is_default : konst. has_body ,
380
+ is_default : konst. flags . contains ( ConstFlags :: HAS_BODY ) ,
378
381
type_repr,
379
382
visibility,
380
383
} )
@@ -407,9 +410,9 @@ fn emit_static(
407
410
body : None ,
408
411
type_repr,
409
412
visibility,
410
- is_mut : statik. mutable ,
413
+ is_mut : statik. flags . contains ( StaticFlags :: MUTABLE ) ,
411
414
is_static : true ,
412
- is_unsafe : statik. has_unsafe_kw ,
415
+ is_unsafe : statik. flags . contains ( StaticFlags :: HAS_UNSAFE_KW ) ,
413
416
} )
414
417
. into ( ) ,
415
418
) ;
@@ -774,7 +777,9 @@ fn const_or_function(
774
777
let type_: & chalk_ir:: Ty < Interner > = type_. skip_binders ( ) ;
775
778
match type_. kind ( ra_ap_hir_ty:: Interner ) {
776
779
chalk_ir:: TyKind :: FnDef ( fn_def_id, parameters) => {
777
- let data = db. fn_def_datum ( * fn_def_id) ;
780
+ let callable_def_id =
781
+ db. lookup_intern_callable_def ( InternedCallableDefId :: from ( * fn_def_id) ) ;
782
+ let data = db. fn_def_datum ( callable_def_id) ;
778
783
779
784
let sig = ra_ap_hir_ty:: CallableSig :: from_def ( db, * fn_def_id, parameters) ;
780
785
let params = sig
@@ -1200,7 +1205,7 @@ fn emit_hir_ty(
1200
1205
substitution : _,
1201
1206
} ) )
1202
1207
| chalk_ir:: TyKind :: AssociatedType ( associated_ty_id, _) => {
1203
- let assoc_ty_data = db. associated_ty_data ( * associated_ty_id) ;
1208
+ let assoc_ty_data = db. associated_ty_data ( from_assoc_type_id ( * associated_ty_id) ) ;
1204
1209
1205
1210
let _name = db
1206
1211
. type_alias_data ( assoc_ty_data. name )
@@ -1302,6 +1307,7 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari
1302
1307
trap. emit ( generated:: StructField {
1303
1308
id : trap:: TrapId :: Star ,
1304
1309
attrs : vec ! [ ] ,
1310
+ is_unsafe : false ,
1305
1311
name,
1306
1312
type_repr,
1307
1313
visibility,
0 commit comments