File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ fn build_reexport_def_map(
104
104
105
105
// FIXME: Do a parallel fold
106
106
let fold = fold:: fold ( {
107
- fold_mod: fold_mod
107
+ fold_mod: fold_mod,
108
+ fold_nmod: fold_nmod
108
109
with * fold:: default_seq_fold ( ctxt)
109
110
} ) ;
110
111
@@ -124,6 +125,19 @@ fn build_reexport_def_map(
124
125
125
126
ret doc;
126
127
}
128
+
129
+ fn fold_nmod ( fold : fold:: fold < ctxt > , doc : doc:: nmoddoc ) -> doc:: nmoddoc {
130
+ let doc = fold:: default_seq_fold_nmod ( fold, doc) ;
131
+
132
+ for fndoc in doc. fns {
133
+ let def_id = ast_util:: local_def ( fndoc. id ( ) ) ;
134
+ if fold. ctxt . def_set . contains_key ( def_id) {
135
+ fold. ctxt . def_map . insert ( def_id, doc:: fntag ( fndoc) ) ;
136
+ }
137
+ }
138
+
139
+ ret doc;
140
+ }
127
141
}
128
142
129
143
fn build_reexport_path_map ( srv : astsrv:: srv , -def_map : def_map ) -> path_map {
@@ -298,6 +312,14 @@ fn should_mark_reepxorts_as_such() {
298
312
assert doc. topmod . mods ( ) [ 1 ] . fns ( ) [ 0 ] . item . reexport == true ;
299
313
}
300
314
315
+ #[ test]
316
+ fn should_duplicate_reexported_native_fns ( ) {
317
+ let source = "native mod a { fn b(); } \
318
+ mod c { import a::b; export b; }";
319
+ let doc = test:: mk_doc ( source) ;
320
+ assert doc. topmod . mods ( ) [ 0 ] . fns ( ) [ 0 ] . name ( ) == "b" ;
321
+ }
322
+
301
323
#[ test]
302
324
fn should_duplicate_multiple_reexported_items ( ) {
303
325
let source = "mod a { \
You can’t perform that action at this time.
0 commit comments