@@ -285,8 +285,8 @@ impl TypeMap {
285
285
// unique ptr (~) -> {~ :pointee-uid:}
286
286
// @-ptr (@) -> {@ :pointee-uid:}
287
287
// sized vec ([T, ..x]) -> {[:size:] :element-uid:}
288
- // vec slice (& [T]) -> {&<mut> [] :element-uid:}
289
- // trait (~ | &[mut] T) -> {:sigil: trait_:svh: / :node-id:_<(:param-uid:),*> }
288
+ // unsized vec ( [T]) -> {[] :element-uid:}
289
+ // trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
290
290
// closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
291
291
// :return-type-uid: : (:bounds:)*}
292
292
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
@@ -361,18 +361,12 @@ impl TypeMap {
361
361
let inner_type_id = self . get_unique_type_id_as_string ( inner_type_id) ;
362
362
unique_type_id. push_str ( inner_type_id. as_slice ( ) ) ;
363
363
} ,
364
- ty:: ty_vec( ty:: mt { ty : inner_type, mutbl } , optional_length) => {
364
+ ty:: ty_vec( ty:: mt { ty : inner_type, .. } , optional_length) => {
365
365
match optional_length {
366
366
Some ( len) => {
367
367
unique_type_id. push_str ( format ! ( "[{}]" , len) . as_slice ( ) ) ;
368
368
}
369
369
None => {
370
- unique_type_id. push_char ( '&' ) ;
371
-
372
- if mutbl == ast:: MutMutable {
373
- unique_type_id. push_str ( "mut" ) ;
374
- }
375
-
376
370
unique_type_id. push_str ( "[]" ) ;
377
371
}
378
372
} ;
@@ -382,12 +376,6 @@ impl TypeMap {
382
376
unique_type_id. push_str ( inner_type_id. as_slice ( ) ) ;
383
377
} ,
384
378
ty:: ty_trait( ref trait_data) => {
385
- match trait_data. store {
386
- ty:: UniqTraitStore => unique_type_id. push_char ( '~' ) ,
387
- ty:: RegionTraitStore ( _, ast:: MutMutable ) => unique_type_id. push_str ( "&mut" ) ,
388
- ty:: RegionTraitStore ( _, ast:: MutImmutable ) => unique_type_id. push_char ( '&' ) ,
389
- } ;
390
-
391
379
unique_type_id. push_str ( "trait " ) ;
392
380
393
381
from_def_id_and_substs ( self ,
@@ -2901,6 +2889,16 @@ fn type_metadata(cx: &CrateContext,
2901
2889
let i8_t = ty:: mk_i8 ( ) ;
2902
2890
heap_vec_metadata ( cx, pointee_type, i8_t, unique_type_id, usage_site_span)
2903
2891
}
2892
+ ty:: ty_trait( box ty:: TyTrait {
2893
+ def_id,
2894
+ ref substs,
2895
+ ref bounds
2896
+ } ) => {
2897
+ MetadataCreationResult :: new (
2898
+ trait_metadata ( cx, def_id, t, substs, ty:: UniqTraitStore ,
2899
+ bounds, unique_type_id) ,
2900
+ false )
2901
+ }
2904
2902
_ => {
2905
2903
let pointee_metadata = type_metadata ( cx, pointee_type, usage_site_span) ;
2906
2904
return_if_created_in_meantime ! ( ) ;
@@ -2917,6 +2915,17 @@ fn type_metadata(cx: &CrateContext,
2917
2915
ty:: ty_str => {
2918
2916
vec_slice_metadata ( cx, t, ty:: mk_i8 ( ) , unique_type_id, usage_site_span)
2919
2917
}
2918
+ ty:: ty_trait( box ty:: TyTrait {
2919
+ def_id,
2920
+ ref substs,
2921
+ ref bounds
2922
+ } ) => {
2923
+ MetadataCreationResult :: new (
2924
+ trait_metadata ( cx, def_id, t, substs,
2925
+ ty:: RegionTraitStore ( ty:: ReStatic , mt. mutbl ) ,
2926
+ bounds, unique_type_id) ,
2927
+ false )
2928
+ }
2920
2929
_ => {
2921
2930
let pointee = type_metadata ( cx, mt. ty , usage_site_span) ;
2922
2931
return_if_created_in_meantime ! ( ) ;
@@ -2930,16 +2939,6 @@ fn type_metadata(cx: &CrateContext,
2930
2939
ty:: ty_closure( ref closurety) => {
2931
2940
subroutine_type_metadata ( cx, unique_type_id, & closurety. sig , usage_site_span)
2932
2941
}
2933
- ty:: ty_trait( box ty:: TyTrait {
2934
- def_id,
2935
- ref substs,
2936
- store,
2937
- ref bounds
2938
- } ) => {
2939
- MetadataCreationResult :: new (
2940
- trait_metadata ( cx, def_id, t, substs, store, bounds, unique_type_id) ,
2941
- false )
2942
- }
2943
2942
ty:: ty_struct( def_id, ref substs) => {
2944
2943
prepare_struct_metadata ( cx,
2945
2944
t,
0 commit comments