@@ -183,15 +183,12 @@ impl CrateTranslator<'_> {
183
183
} )
184
184
}
185
185
186
- fn emit_unimplemented ( & mut self , location : Option < trap:: Label > ) -> trap:: Label {
187
- self . trap . emit ( generated:: Unimplemented {
186
+ fn emit_path ( & mut self , _path : & Path , location : Option < trap:: Label > ) -> trap:: Label {
187
+ self . trap . emit ( generated:: Path {
188
188
id : TrapId :: Star ,
189
189
location,
190
190
} )
191
191
}
192
- fn emit_path ( & mut self , _path : & Path , location : Option < trap:: Label > ) -> trap:: Label {
193
- self . emit_unimplemented ( location)
194
- }
195
192
196
193
fn emit_record_field_pat (
197
194
& mut self ,
@@ -610,9 +607,12 @@ impl CrateTranslator<'_> {
610
607
. into_iter ( )
611
608
. map ( |e| self . emit_expr ( * e, body, source_map) )
612
609
. collect ( ) ;
613
- let generic_args = generic_args
614
- . as_ref ( )
615
- . map ( |_args| self . emit_unimplemented ( None ) ) ;
610
+ let generic_args = generic_args. as_ref ( ) . map ( |_args| {
611
+ self . trap . emit ( generated:: GenericArgs {
612
+ id : TrapId :: Star ,
613
+ location : None ,
614
+ } )
615
+ } ) ;
616
616
self . trap . emit ( generated:: MethodCallExpr {
617
617
id : TrapId :: Star ,
618
618
location,
@@ -929,8 +929,12 @@ impl CrateTranslator<'_> {
929
929
labels : & mut Vec < trap:: Label > ,
930
930
) {
931
931
match id {
932
- ModuleDef :: Module ( _) => {
933
- self . emit_unimplemented ( None ) ;
932
+ ModuleDef :: Module ( _module) => {
933
+ let location = None ;
934
+ self . trap . emit ( generated:: UnimplementedDeclaration {
935
+ id : TrapId :: Star ,
936
+ location,
937
+ } ) ;
934
938
}
935
939
ModuleDef :: Function ( function) => {
936
940
let def: ra_ap_hir:: DefWithBody = function. into ( ) ;
@@ -958,38 +962,66 @@ impl CrateTranslator<'_> {
958
962
}
959
963
ModuleDef :: Adt ( adt) => {
960
964
let location = self . emit_location ( adt) ;
961
- self . emit_unimplemented ( location) ;
965
+ self . trap . emit ( generated:: UnimplementedDeclaration {
966
+ id : TrapId :: Star ,
967
+ location,
968
+ } ) ;
962
969
}
963
970
ModuleDef :: Variant ( variant) => {
964
971
let location = self . emit_location ( variant) ;
965
- self . emit_unimplemented ( location) ;
972
+ self . trap . emit ( generated:: UnimplementedDeclaration {
973
+ id : TrapId :: Star ,
974
+ location,
975
+ } ) ;
966
976
}
967
977
ModuleDef :: Const ( const_) => {
968
978
let location = self . emit_location ( const_) ;
969
- self . emit_unimplemented ( location) ;
979
+ self . trap . emit ( generated:: UnimplementedDeclaration {
980
+ id : TrapId :: Star ,
981
+ location,
982
+ } ) ;
970
983
}
971
984
ModuleDef :: Static ( static_) => {
972
985
let location = self . emit_location ( static_) ;
973
- self . emit_unimplemented ( location) ;
986
+ self . trap . emit ( generated:: UnimplementedDeclaration {
987
+ id : TrapId :: Star ,
988
+ location,
989
+ } ) ;
974
990
}
975
991
ModuleDef :: Trait ( trait_) => {
976
992
let location = self . emit_location ( trait_) ;
977
- self . emit_unimplemented ( location) ;
993
+ self . trap . emit ( generated:: UnimplementedDeclaration {
994
+ id : TrapId :: Star ,
995
+ location,
996
+ } ) ;
978
997
}
979
998
ModuleDef :: TraitAlias ( alias) => {
980
999
let location = self . emit_location ( alias) ;
981
- self . emit_unimplemented ( location) ;
1000
+ self . trap . emit ( generated:: UnimplementedDeclaration {
1001
+ id : TrapId :: Star ,
1002
+ location,
1003
+ } ) ;
982
1004
}
983
1005
ModuleDef :: TypeAlias ( type_alias) => {
984
1006
let location = self . emit_location ( type_alias) ;
985
- self . emit_unimplemented ( location) ;
1007
+ self . trap . emit ( generated:: UnimplementedDeclaration {
1008
+ id : TrapId :: Star ,
1009
+ location,
1010
+ } ) ;
986
1011
}
987
1012
ModuleDef :: BuiltinType ( _builtin_type) => {
988
- self . emit_unimplemented ( None ) ;
1013
+ let location = None ;
1014
+ self . trap . emit ( generated:: UnimplementedDeclaration {
1015
+ id : TrapId :: Star ,
1016
+ location,
1017
+ } ) ;
989
1018
}
990
1019
ModuleDef :: Macro ( macro_) => {
991
1020
let location = self . emit_location ( macro_) ;
992
- self . emit_unimplemented ( location) ;
1021
+ self . trap . emit ( generated:: UnimplementedDeclaration {
1022
+ id : TrapId :: Star ,
1023
+ location,
1024
+ } ) ;
993
1025
}
994
1026
}
995
1027
}
0 commit comments