File tree 5 files changed +128
-0
lines changed
5 files changed +128
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,23 @@ impl<'a> Visitor<()> for EmbargoVisitor<'a> {
297
297
}
298
298
}
299
299
300
+ ast:: ItemTy ( ref ty, _) if public_first => {
301
+ match ty. node {
302
+ ast:: TyPath ( _, _, id) => {
303
+ match self . tcx . def_map . borrow ( ) . get_copy ( & id) {
304
+ ast:: DefPrimTy ( ..) => { } ,
305
+ def => {
306
+ let did = def_id_of_def ( def) ;
307
+ if is_local ( did) {
308
+ self . exported_items . insert ( did. node ) ;
309
+ }
310
+ }
311
+ }
312
+ }
313
+ _ => { }
314
+ }
315
+ }
316
+
300
317
_ => { }
301
318
}
302
319
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ crate_type="lib" ]
12
+ #![ deny( warnings) ]
13
+
14
+ pub use src:: aliases:: B ;
15
+ pub use src:: hidden_core:: make;
16
+
17
+ mod src {
18
+ pub mod aliases {
19
+ use super :: hidden_core:: A ;
20
+ pub type B = A < f32 > ;
21
+ }
22
+
23
+ pub mod hidden_core {
24
+ use super :: aliases:: B ;
25
+
26
+ pub struct A < T > ;
27
+
28
+ pub fn make ( ) -> B { A }
29
+
30
+ impl < T > A < T > {
31
+ pub fn foo ( & mut self ) { println ! ( "called foo" ) ; }
32
+ }
33
+ }
34
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ crate_type="lib" ]
12
+ #![ deny( warnings) ]
13
+
14
+ pub use src:: aliases:: B ;
15
+ pub use src:: hidden_core:: make;
16
+
17
+ mod src {
18
+ pub mod aliases {
19
+ use super :: hidden_core:: A ;
20
+ pub type B = A ;
21
+ }
22
+
23
+ pub mod hidden_core {
24
+ use super :: aliases:: B ;
25
+
26
+ pub struct A ;
27
+
28
+ pub fn make ( ) -> B { A }
29
+
30
+ impl A {
31
+ pub fn foo ( & mut self ) { println ! ( "called foo" ) ; }
32
+ }
33
+ }
34
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // aux-build:issue-14421.rs
12
+
13
+ extern crate bug_lib = "issue-14421" ;
14
+
15
+ use bug_lib:: B ;
16
+ use bug_lib:: make;
17
+
18
+ pub fn main ( ) {
19
+ let mut an_A: B = make ( ) ;
20
+ an_A. foo ( ) ;
21
+ }
22
+
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // aux-build:issue-14422.rs
12
+
13
+ extern crate bug_lib = "issue-14422" ;
14
+
15
+ use bug_lib:: B ;
16
+ use bug_lib:: make;
17
+
18
+ pub fn main ( ) {
19
+ let mut an_A: B = make ( ) ;
20
+ an_A. foo ( ) ;
21
+ }
You can’t perform that action at this time.
0 commit comments