@@ -214,16 +214,26 @@ fn parse_foreign_mod(
214
214
215
215
let trusted = trusted || foreign_mod. unsafety . is_some ( ) ;
216
216
217
+ let mut namespace = namespace. clone ( ) ;
218
+ attrs:: parse (
219
+ cx,
220
+ & foreign_mod. attrs ,
221
+ attrs:: Parser {
222
+ namespace : Some ( & mut namespace) ,
223
+ ..Default :: default ( )
224
+ } ,
225
+ ) ;
226
+
217
227
let mut items = Vec :: new ( ) ;
218
228
for foreign in & foreign_mod. items {
219
229
match foreign {
220
230
ForeignItem :: Type ( foreign) => {
221
- match parse_extern_type ( cx, foreign, lang, trusted, namespace) {
231
+ match parse_extern_type ( cx, foreign, lang, trusted, & namespace) {
222
232
Ok ( ety) => items. push ( ety) ,
223
233
Err ( err) => cx. push ( err) ,
224
234
}
225
235
}
226
- ForeignItem :: Fn ( foreign) => match parse_extern_fn ( cx, foreign, lang, namespace) {
236
+ ForeignItem :: Fn ( foreign) => match parse_extern_fn ( cx, foreign, lang, & namespace) {
227
237
Ok ( efn) => items. push ( efn) ,
228
238
Err ( err) => cx. push ( err) ,
229
239
} ,
@@ -234,7 +244,7 @@ fn parse_foreign_mod(
234
244
}
235
245
}
236
246
ForeignItem :: Verbatim ( tokens) => {
237
- match parse_extern_verbatim ( cx, tokens, lang, namespace) {
247
+ match parse_extern_verbatim ( cx, tokens, lang, & namespace) {
238
248
Ok ( api) => items. push ( api) ,
239
249
Err ( err) => cx. push ( err) ,
240
250
}
0 commit comments