Skip to content

Commit 2271860

Browse files
committed
rename ast::ViewItemExternMod to ast::ViewItemExternCrate, and clean::ExternMod to clean::ExternCrate
1 parent 28e7631 commit 2271860

File tree

16 files changed

+29
-29
lines changed

16 files changed

+29
-29
lines changed

src/librustc/front/feature_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Visitor<()> for Context {
134134
}
135135
}
136136
}
137-
ast::ViewItemExternMod(..) => {
137+
ast::ViewItemExternCrate(..) => {
138138
for attr in i.attrs.iter() {
139139
if attr.name().get() == "phase"{
140140
self.gate_feature("phase", attr.span,

src/librustc/front/std_inject.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn with_version(krate: &str) -> Option<(InternedString, ast::StrStyle)> {
7474
impl fold::Folder for StandardLibraryInjector {
7575
fn fold_crate(&mut self, krate: ast::Crate) -> ast::Crate {
7676
let mut vis = vec!(ast::ViewItem {
77-
node: ast::ViewItemExternMod(token::str_to_ident("std"),
77+
node: ast::ViewItemExternCrate(token::str_to_ident("std"),
7878
with_version("std"),
7979
ast::DUMMY_NODE_ID),
8080
attrs: vec!(
@@ -90,15 +90,15 @@ impl fold::Folder for StandardLibraryInjector {
9090

9191
if use_uv(&krate) && !self.sess.building_library.get() {
9292
vis.push(ast::ViewItem {
93-
node: ast::ViewItemExternMod(token::str_to_ident("green"),
93+
node: ast::ViewItemExternCrate(token::str_to_ident("green"),
9494
with_version("green"),
9595
ast::DUMMY_NODE_ID),
9696
attrs: Vec::new(),
9797
vis: ast::Inherited,
9898
span: DUMMY_SP
9999
});
100100
vis.push(ast::ViewItem {
101-
node: ast::ViewItemExternMod(token::str_to_ident("rustuv"),
101+
node: ast::ViewItemExternCrate(token::str_to_ident("rustuv"),
102102
with_version("rustuv"),
103103
ast::DUMMY_NODE_ID),
104104
attrs: Vec::new(),

src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ fn mk_std(cx: &TestCtxt) -> ast::ViewItem {
306306
path_node(~[id_test]),
307307
ast::DUMMY_NODE_ID))))
308308
} else {
309-
ast::ViewItemExternMod(id_test,
309+
ast::ViewItemExternCrate(id_test,
310310
with_version("test"),
311311
ast::DUMMY_NODE_ID)
312312
};

src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct CrateInfo {
167167

168168
fn extract_crate_info(e: &Env, i: &ast::ViewItem) -> Option<CrateInfo> {
169169
match i.node {
170-
ast::ViewItemExternMod(ident, ref path_opt, id) => {
170+
ast::ViewItemExternCrate(ident, ref path_opt, id) => {
171171
let ident = token::get_ident(ident);
172172
debug!("resolving extern crate stmt. ident: {:?} path_opt: {:?}",
173173
ident, path_opt);

src/librustc/middle/privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ impl<'a> Visitor<()> for PrivacyVisitor<'a> {
845845

846846
fn visit_view_item(&mut self, a: &ast::ViewItem, _: ()) {
847847
match a.node {
848-
ast::ViewItemExternMod(..) => {}
848+
ast::ViewItemExternCrate(..) => {}
849849
ast::ViewItemUse(ref uses) => {
850850
for vpath in uses.iter() {
851851
match vpath.node {
@@ -976,7 +976,7 @@ impl Visitor<()> for SanePrivacyVisitor {
976976
reachable");
977977
} else {
978978
match i.node {
979-
ast::ViewItemExternMod(..) => {
979+
ast::ViewItemExternCrate(..) => {
980980
self.tcx.sess.span_err(i.span, "`pub` visibility \
981981
is not allowed");
982982
}

src/librustc/middle/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ impl Resolver {
15161516
}
15171517
}
15181518

1519-
ViewItemExternMod(name, _, node_id) => {
1519+
ViewItemExternCrate(name, _, node_id) => {
15201520
// n.b. we don't need to look at the path option here, because cstore already did
15211521
match self.session.cstore.find_extern_mod_stmt_cnum(node_id) {
15221522
Some(crate_id) => {
@@ -5415,7 +5415,7 @@ impl Resolver {
54155415
if vi.span == DUMMY_SP { return }
54165416

54175417
match vi.node {
5418-
ViewItemExternMod(..) => {} // ignore
5418+
ViewItemExternCrate(..) => {} // ignore
54195419
ViewItemUse(ref path) => {
54205420
for p in path.iter() {
54215421
match p.node {

src/librustdoc/clean.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,19 +1066,19 @@ impl Clean<Item> for ast::ViewItem {
10661066

10671067
#[deriving(Clone, Encodable, Decodable)]
10681068
pub enum ViewItemInner {
1069-
ExternMod(~str, Option<~str>, ast::NodeId),
1069+
ExternCrate(~str, Option<~str>, ast::NodeId),
10701070
Import(~[ViewPath])
10711071
}
10721072

10731073
impl Clean<ViewItemInner> for ast::ViewItem_ {
10741074
fn clean(&self) -> ViewItemInner {
10751075
match self {
1076-
&ast::ViewItemExternMod(ref i, ref p, ref id) => {
1076+
&ast::ViewItemExternCrate(ref i, ref p, ref id) => {
10771077
let string = match *p {
10781078
None => None,
10791079
Some((ref x, _)) => Some(x.get().to_owned()),
10801080
};
1081-
ExternMod(i.clean(), string, *id)
1081+
ExternCrate(i.clean(), string, *id)
10821082
}
10831083
&ast::ViewItemUse(ref vp) => {
10841084
Import(vp.clean().move_iter().collect())

src/librustdoc/html/render.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ fn item_module(w: &mut Writer, cx: &Context,
960960
match (&i1.inner, &i2.inner) {
961961
(&clean::ViewItemItem(ref a), &clean::ViewItemItem(ref b)) => {
962962
match (&a.inner, &b.inner) {
963-
(&clean::ExternMod(..), _) => Less,
964-
(_, &clean::ExternMod(..)) => Greater,
963+
(&clean::ExternCrate(..), _) => Less,
964+
(_, &clean::ExternCrate(..)) => Greater,
965965
_ => idx1.cmp(&idx2),
966966
}
967967
}
@@ -1056,7 +1056,7 @@ fn item_module(w: &mut Writer, cx: &Context,
10561056

10571057
clean::ViewItemItem(ref item) => {
10581058
match item.inner {
1059-
clean::ExternMod(ref name, ref src, _) => {
1059+
clean::ExternCrate(ref name, ref src, _) => {
10601060
try!(write!(w, "<tr><td><code>extern crate {}",
10611061
name.as_slice()));
10621062
match *src {

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'a> RustdocVisitor<'a> {
147147
}
148148
}
149149
}
150-
ast::ViewItemExternMod(..) => item.clone()
150+
ast::ViewItemExternCrate(..) => item.clone()
151151
};
152152
om.view_items.push(item);
153153
}

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ pub enum ViewItem_ {
10191019
// optional (InternedString,StrStyle): if present, this is a location
10201020
// (containing arbitrary characters) from which to fetch the crate sources
10211021
// For example, extern crate whatever = "github.com/mozilla/rust"
1022-
ViewItemExternMod(Ident, Option<(InternedString,StrStyle)>, NodeId),
1022+
ViewItemExternCrate(Ident, Option<(InternedString,StrStyle)>, NodeId),
10231023
ViewItemUse(Vec<@ViewPath> ),
10241024
}
10251025

0 commit comments

Comments
 (0)