@@ -2845,46 +2845,6 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
2845
2845
}
2846
2846
}
2847
2847
}
2848
-
2849
- hir_map:: NodeVariant ( ref v) => {
2850
- let llfn;
2851
- let fields = if v. node . data . is_struct ( ) {
2852
- ccx. sess ( ) . bug ( "struct variant kind unexpected in get_item_val" )
2853
- } else {
2854
- v. node . data . fields ( )
2855
- } ;
2856
- assert ! ( !fields. is_empty( ) ) ;
2857
- let ty = ccx. tcx ( ) . node_id_to_type ( id) ;
2858
- let parent = ccx. tcx ( ) . map . get_parent ( id) ;
2859
- let enm = ccx. tcx ( ) . map . expect_item ( parent) ;
2860
- let sym = exported_name ( ccx, id, ty, & enm. attrs ) ;
2861
-
2862
- llfn = match enm. node {
2863
- hir:: ItemEnum ( _, _) => {
2864
- register_fn ( ccx, ( * v) . span , sym, id, ty)
2865
- }
2866
- _ => ccx. sess ( ) . bug ( "NodeVariant, shouldn't happen" ) ,
2867
- } ;
2868
- attributes:: inline ( llfn, attributes:: InlineAttr :: Hint ) ;
2869
- llfn
2870
- }
2871
-
2872
- hir_map:: NodeStructCtor ( struct_def) => {
2873
- // Only register the constructor if this is a tuple-like struct.
2874
- let ctor_id = if struct_def. is_struct ( ) {
2875
- ccx. sess ( ) . bug ( "attempt to register a constructor of a non-tuple-like struct" )
2876
- } else {
2877
- struct_def. id ( )
2878
- } ;
2879
- let parent = ccx. tcx ( ) . map . get_parent ( id) ;
2880
- let struct_item = ccx. tcx ( ) . map . expect_item ( parent) ;
2881
- let ty = ccx. tcx ( ) . node_id_to_type ( ctor_id) ;
2882
- let sym = exported_name ( ccx, id, ty, & struct_item. attrs ) ;
2883
- let llfn = register_fn ( ccx, struct_item. span , sym, ctor_id, ty) ;
2884
- attributes:: inline ( llfn, attributes:: InlineAttr :: Hint ) ;
2885
- llfn
2886
- }
2887
-
2888
2848
ref variant => {
2889
2849
ccx. sess ( ) . bug ( & format ! ( "get_item_val(): unexpected variant: {:?}" , variant) )
2890
2850
}
0 commit comments