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