@@ -18,15 +18,18 @@ use ra_ap_hir_def::{
1818} ;
1919use ra_ap_hir_def:: { HasModule , visibility:: VisibilityExplicitness } ;
2020use ra_ap_hir_def:: { ModuleId , resolver:: HasResolver } ;
21- use ra_ap_hir_ty:: TraitRefExt ;
2221use ra_ap_hir_ty:: Ty ;
2322use ra_ap_hir_ty:: TyExt ;
2423use ra_ap_hir_ty:: WhereClause ;
2524use ra_ap_hir_ty:: { Binders , FnPointer } ;
2625use ra_ap_hir_ty:: { Interner , ProjectionTy } ;
26+ use ra_ap_hir_ty:: { TraitRefExt , from_assoc_type_id} ;
2727use ra_ap_ide_db:: RootDatabase ;
2828use ra_ap_vfs:: { Vfs , VfsPath } ;
2929
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 ;
3033use std:: hash:: Hasher ;
3134use std:: { cmp:: Ordering , collections:: HashMap , path:: PathBuf } ;
3235use std:: { hash:: Hash , vec} ;
@@ -374,7 +377,7 @@ fn emit_const(
374377 attrs : vec ! [ ] ,
375378 body : None ,
376379 is_const : true ,
377- is_default : konst. has_body ,
380+ is_default : konst. flags . contains ( ConstFlags :: HAS_BODY ) ,
378381 type_repr,
379382 visibility,
380383 } )
@@ -407,9 +410,9 @@ fn emit_static(
407410 body : None ,
408411 type_repr,
409412 visibility,
410- is_mut : statik. mutable ,
413+ is_mut : statik. flags . contains ( StaticFlags :: MUTABLE ) ,
411414 is_static : true ,
412- is_unsafe : statik. has_unsafe_kw ,
415+ is_unsafe : statik. flags . contains ( StaticFlags :: HAS_UNSAFE_KW ) ,
413416 } )
414417 . into ( ) ,
415418 ) ;
@@ -774,7 +777,9 @@ fn const_or_function(
774777 let type_: & chalk_ir:: Ty < Interner > = type_. skip_binders ( ) ;
775778 match type_. kind ( ra_ap_hir_ty:: Interner ) {
776779 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) ;
778783
779784 let sig = ra_ap_hir_ty:: CallableSig :: from_def ( db, * fn_def_id, parameters) ;
780785 let params = sig
@@ -1200,7 +1205,7 @@ fn emit_hir_ty(
12001205 substitution : _,
12011206 } ) )
12021207 | 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) ) ;
12041209
12051210 let _name = db
12061211 . type_alias_data ( assoc_ty_data. name )
@@ -1302,6 +1307,7 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari
13021307 trap. emit ( generated:: StructField {
13031308 id : trap:: TrapId :: Star ,
13041309 attrs : vec ! [ ] ,
1310+ is_unsafe : false ,
13051311 name,
13061312 type_repr,
13071313 visibility,
0 commit comments