@@ -60,10 +60,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
60
60
ident : Ident ,
61
61
ns : Namespace ,
62
62
res : Res ,
63
- vis : Visibility < impl Into < DefId > > ,
63
+ vis : Visibility ,
64
64
span : Span ,
65
65
expn_id : LocalExpnId ,
66
66
) {
67
+ assert ! ( parent. is_local( ) ) ;
68
+ assert ! ( res. opt_def_id( ) . is_none_or( |def_id| def_id. is_local( ) ) ) ;
67
69
let binding = self . arenas . new_res_binding ( res, vis. to_def_id ( ) , span, expn_id) ;
68
70
self . define_binding_local ( parent, ident, ns, binding)
69
71
}
@@ -75,18 +77,18 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
75
77
ident : Ident ,
76
78
ns : Namespace ,
77
79
res : Res ,
78
- vis : Visibility < impl Into < DefId > > ,
80
+ vis : Visibility < DefId > ,
79
81
span : Span ,
80
82
expn_id : LocalExpnId ,
81
83
) {
82
- let binding = self . arenas . new_res_binding ( res, vis. to_def_id ( ) , span, expn_id) ;
84
+ assert ! ( !parent. is_local( ) ) ;
85
+ assert ! ( !res. opt_def_id( ) . is_some_and( |def_id| def_id. is_local( ) ) , "res: {res:?} is local" ) ;
86
+ let binding = self . arenas . new_res_binding ( res, vis, span, expn_id) ;
83
87
let key = self . new_disambiguated_key ( ident, ns) ;
84
- self . check_reserved_macro_name ( key. ident , binding. res ( ) ) ;
85
88
let resolution = & mut * self . resolution ( parent, key) . borrow_mut ( ) ;
86
89
if resolution. binding . is_some ( ) {
87
90
panic ! ( "An external binding was already defined" ) ;
88
91
}
89
- // FIXME: maybe some handling of glob-importers
90
92
resolution. binding = Some ( binding) ;
91
93
}
92
94
0 commit comments