Skip to content

Commit 8370137

Browse files
committed
auto merge of #14509 : klutzy/rust/de-pub-use-glob, r=alexcrichton
This patchset removes `pub use` usage except for `test/`. cc #11870
2 parents 46dad76 + 976c832 commit 8370137

File tree

20 files changed

+44
-15
lines changed

20 files changed

+44
-15
lines changed

src/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ An example of re-exporting:
904904
~~~~
905905
# fn main() { }
906906
mod quux {
907-
pub use quux::foo::*;
907+
pub use quux::foo::{bar, baz};
908908
909909
pub mod foo {
910910
pub fn bar() { }
@@ -913,10 +913,10 @@ mod quux {
913913
}
914914
~~~~
915915

916-
In this example, the module `quux` re-exports all of the public names defined in `foo`.
916+
In this example, the module `quux` re-exports two public names defined in `foo`.
917917

918918
Also note that the paths contained in `use` items are relative to the crate root.
919-
So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`.
919+
So, in the previous example, the `use` refers to `quux::foo::{bar, baz}`, and not simply to `foo::{bar, baz}`.
920920
This also means that top-level module declarations should be at the crate root if direct usage
921921
of the declared modules within `use` items is desired. It is also possible to use `self` and `super`
922922
at the beginning of a `use` item to refer to the current and direct parent modules respectively.

src/libregex_macros/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
html_root_url = "http://doc.rust-lang.org/")]
2121

2222
#![feature(macro_registrar, managed_boxes, quote)]
23+
#![allow(unused_imports)] // `quote_expr!` adds some `use` globs which may be unused
2324

2425
extern crate regex;
2526
extern crate syntax;

src/libsyntax/ext/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
// except according to those terms.
1010

1111
use abi;
12-
use ast::{P, Ident};
12+
use ast::{P, Ident, Generics, NodeId, Expr};
1313
use ast;
1414
use ast_util;
1515
use attr;
1616
use codemap::{Span, respan, Spanned, DUMMY_SP};
1717
use ext::base::ExtCtxt;
18-
use ext::quote::rt::*;
1918
use fold::Folder;
2019
use owned_slice::OwnedSlice;
2120
use parse::token::special_idents;
21+
use parse::token::InternedString;
2222
use parse::token;
2323

2424
pub struct Field {

src/libsyntax/ext/deriving/bounds.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use ast::{MetaItem, MetaWord, Item};
1212
use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::deriving::generic::*;
15+
use ext::deriving::generic::ty::*;
1516

1617
pub fn expand_deriving_bound(cx: &mut ExtCtxt,
1718
span: Span,

src/libsyntax/ext/deriving/clone.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16+
use ext::deriving::generic::ty::*;
1617
use parse::token::InternedString;
1718

1819
pub fn expand_deriving_clone(cx: &mut ExtCtxt,

src/libsyntax/ext/deriving/cmp/eq.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16+
use ext::deriving::generic::ty::*;
1617
use parse::token::InternedString;
1718

1819
pub fn expand_deriving_eq(cx: &mut ExtCtxt,

src/libsyntax/ext/deriving/cmp/ord.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::AstBuilder;
1616
use ext::deriving::generic::*;
17+
use ext::deriving::generic::ty::*;
1718
use parse::token::InternedString;
1819

1920
pub fn expand_deriving_ord(cx: &mut ExtCtxt,

src/libsyntax/ext/deriving/cmp/totaleq.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use codemap::Span;
1313
use ext::base::ExtCtxt;
1414
use ext::build::AstBuilder;
1515
use ext::deriving::generic::*;
16+
use ext::deriving::generic::ty::*;
1617
use parse::token::InternedString;
1718

1819
pub fn expand_deriving_totaleq(cx: &mut ExtCtxt,

src/libsyntax/ext/deriving/cmp/totalord.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use codemap::Span;
1414
use ext::base::ExtCtxt;
1515
use ext::build::AstBuilder;
1616
use ext::deriving::generic::*;
17+
use ext::deriving::generic::ty::*;
1718
use parse::token::InternedString;
1819

1920
use std::cmp::{Ordering, Equal, Less, Greater};

src/libsyntax/ext/deriving/decodable.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use codemap::Span;
1919
use ext::base::ExtCtxt;
2020
use ext::build::AstBuilder;
2121
use ext::deriving::generic::*;
22+
use ext::deriving::generic::ty::*;
2223
use parse::token::InternedString;
2324
use parse::token;
2425

0 commit comments

Comments
 (0)