Skip to content

Commit 230cf07

Browse files
committed
---
yaml --- r: 234827 b: refs/heads/tmp c: a636a83 h: refs/heads/master i: 234825: ff8591b 234823: bcff152 v: v3
1 parent 61a5c4c commit 230cf07

File tree

11 files changed

+41
-40
lines changed

11 files changed

+41
-40
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 64fb709f99bdfb7d9a182eeaa068c7f209ce421b
28+
refs/heads/tmp: a636a83caa483df687732649204d71dda66a5723
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ fn encode_macro_defs(rbml_w: &mut Encoder,
17871787
for def in &krate.exported_macros {
17881788
rbml_w.start_tag(tag_macro_def);
17891789

1790-
encode_name(rbml_w, def.ident.name);
1790+
encode_name(rbml_w, def.name);
17911791
encode_attributes(rbml_w, &def.attrs);
17921792

17931793
rbml_w.wr_tagged_str(tag_macro_def_body,

branches/tmp/src/librustc_front/hir.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,11 @@ pub struct Crate {
333333
/// Not parsed directly, but created on macro import or `macro_rules!` expansion.
334334
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
335335
pub struct MacroDef {
336-
pub ident: Ident,
336+
pub name: Name,
337337
pub attrs: Vec<Attribute>,
338338
pub id: NodeId,
339339
pub span: Span,
340-
pub imported_from: Option<Ident>,
340+
pub imported_from: Option<Name>,
341341
pub export: bool,
342342
pub use_locally: bool,
343343
pub allow_internal_unstable: bool,
@@ -1039,14 +1039,14 @@ pub type Variant = Spanned<Variant_>;
10391039
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
10401040
pub enum PathListItem_ {
10411041
PathListIdent {
1042-
name: Ident,
1042+
name: Name,
10431043
/// renamed in list, eg `use foo::{bar as baz};`
1044-
rename: Option<Ident>,
1044+
rename: Option<Name>,
10451045
id: NodeId
10461046
},
10471047
PathListMod {
10481048
/// renamed in list, eg `use foo::{self as baz};`
1049-
rename: Option<Ident>,
1049+
rename: Option<Name>,
10501050
id: NodeId
10511051
}
10521052
}
@@ -1058,7 +1058,7 @@ impl PathListItem_ {
10581058
}
10591059
}
10601060

1061-
pub fn rename(&self) -> Option<Ident> {
1061+
pub fn rename(&self) -> Option<Name> {
10621062
match *self {
10631063
PathListIdent { rename, .. } | PathListMod { rename, .. } => rename
10641064
}
@@ -1077,7 +1077,7 @@ pub enum ViewPath_ {
10771077
/// or just
10781078
///
10791079
/// `foo::bar::baz` (with `as baz` implicitly on the right)
1080-
ViewPathSimple(Ident, Path),
1080+
ViewPathSimple(Name, Path),
10811081

10821082
/// `foo::bar::*`
10831083
ViewPathGlob(Path),

branches/tmp/src/librustc_front/lowering.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn lower_view_path(view_path: &ViewPath) -> P<hir::ViewPath> {
2222
P(Spanned {
2323
node: match view_path.node {
2424
ViewPathSimple(ident, ref path) => {
25-
hir::ViewPathSimple(ident, lower_path(path))
25+
hir::ViewPathSimple(ident.name, lower_path(path))
2626
}
2727
ViewPathGlob(ref path) => {
2828
hir::ViewPathGlob(lower_path(path))
@@ -35,11 +35,14 @@ pub fn lower_view_path(view_path: &ViewPath) -> P<hir::ViewPath> {
3535
PathListIdent { id, name, rename } =>
3636
hir::PathListIdent {
3737
id: id,
38-
name: name,
39-
rename: rename.clone(),
38+
name: name.name,
39+
rename: rename.map(|x| x.name),
4040
},
4141
PathListMod { id, rename } =>
42-
hir::PathListMod { id: id, rename: rename.clone() }
42+
hir::PathListMod {
43+
id: id,
44+
rename: rename.map(|x| x.name)
45+
}
4346
},
4447
span: path_list_ident.span
4548
}
@@ -526,11 +529,11 @@ pub fn lower_crate(c: &Crate) -> hir::Crate {
526529

527530
pub fn lower_macro_def(m: &MacroDef) -> hir::MacroDef {
528531
hir::MacroDef {
529-
ident: m.ident,
532+
name: m.ident.name,
530533
attrs: m.attrs.clone(),
531534
id: m.id,
532535
span: m.span,
533-
imported_from: m.imported_from,
536+
imported_from: m.imported_from.map(|x| x.name),
534537
export: m.export,
535538
use_locally: m.use_locally,
536539
allow_internal_unstable: m.allow_internal_unstable,

branches/tmp/src/librustc_front/print/pprust.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,15 +2174,14 @@ impl<'a> State<'a> {
21742174

21752175
pub fn print_view_path(&mut self, vp: &hir::ViewPath) -> io::Result<()> {
21762176
match vp.node {
2177-
hir::ViewPathSimple(ident, ref path) => {
2177+
hir::ViewPathSimple(name, ref path) => {
21782178
try!(self.print_path(path, false, 0));
21792179

21802180
// FIXME(#6993) can't compare identifiers directly here
2181-
if path.segments.last().unwrap().identifier.name !=
2182-
ident.name {
2181+
if path.segments.last().unwrap().identifier.name != name {
21832182
try!(space(&mut self.s));
21842183
try!(self.word_space("as"));
2185-
try!(self.print_ident(ident));
2184+
try!(self.print_name(name));
21862185
}
21872186

21882187
Ok(())
@@ -2203,7 +2202,7 @@ impl<'a> State<'a> {
22032202
try!(self.commasep(Inconsistent, &idents[..], |s, w| {
22042203
match w.node {
22052204
hir::PathListIdent { name, .. } => {
2206-
s.print_ident(name)
2205+
s.print_name(name)
22072206
},
22082207
hir::PathListMod { .. } => {
22092208
word(&mut s.s, "self")

branches/tmp/src/librustc_resolve/build_reduced_graph.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
312312
ResolutionError::SelfImportsOnlyAllowedWithin);
313313
}
314314

315-
let subclass = SingleImport(binding.name,
316-
source_name);
315+
let subclass = SingleImport(binding, source_name);
317316
self.build_import_directive(&**parent,
318317
module_path,
319318
subclass,
@@ -343,7 +342,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
343342
for source_item in source_items {
344343
let (module_path, name, rename) = match source_item.node {
345344
PathListIdent { name, rename, .. } =>
346-
(module_path.clone(), name.name, rename.unwrap_or(name).name),
345+
(module_path.clone(), name, rename.unwrap_or(name)),
347346
PathListMod { rename, .. } => {
348347
let name = match module_path.last() {
349348
Some(name) => *name,
@@ -358,7 +357,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
358357
}
359358
};
360359
let module_path = module_path.split_last().unwrap().1;
361-
let rename = rename.map(|n| n.name).unwrap_or(name);
360+
let rename = rename.unwrap_or(name);
362361
(module_path.to_vec(), name, rename)
363362
}
364363
};

branches/tmp/src/librustc_resolve/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,23 +2210,23 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
22102210

22112211
ItemUse(ref view_path) => {
22122212
// check for imports shadowing primitive types
2213-
let check_rename = |this: &Self, id, ident: Ident| {
2213+
let check_rename = |this: &Self, id, name| {
22142214
match this.def_map.borrow().get(&id).map(|d| d.full_def()) {
22152215
Some(DefTy(..)) | Some(DefStruct(..)) | Some(DefTrait(..)) | None => {
2216-
this.check_if_primitive_type_name(ident.name, item.span);
2216+
this.check_if_primitive_type_name(name, item.span);
22172217
}
22182218
_ => {}
22192219
}
22202220
};
22212221

22222222
match view_path.node {
2223-
hir::ViewPathSimple(ident, _) => {
2224-
check_rename(self, item.id, ident);
2223+
hir::ViewPathSimple(name, _) => {
2224+
check_rename(self, item.id, name);
22252225
}
22262226
hir::ViewPathList(ref prefix, ref items) => {
22272227
for item in items {
2228-
if let Some(ident) = item.node.rename() {
2229-
check_rename(self, item.node.id(), ident);
2228+
if let Some(name) = item.node.rename() {
2229+
check_rename(self, item.node.id(), name);
22302230
}
22312231
}
22322232

branches/tmp/src/librustdoc/clean/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use super::{Clean, ToSource};
4343
///
4444
/// The returned value is `None` if the `id` could not be inlined, and `Some`
4545
/// of a vector of items if it was successfully expanded.
46-
pub fn try_inline(cx: &DocContext, id: ast::NodeId, into: Option<ast::Ident>)
46+
pub fn try_inline(cx: &DocContext, id: ast::NodeId, into: Option<ast::Name>)
4747
-> Option<Vec<clean::Item>> {
4848
let tcx = match cx.tcx_opt() {
4949
Some(tcx) => tcx,

branches/tmp/src/librustdoc/clean/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,14 +2386,14 @@ impl Clean<Vec<Item>> for doctree::Import {
23862386
(ret, ImportList(resolve_use_source(cx, p.clean(cx), self.id),
23872387
remaining))
23882388
}
2389-
hir::ViewPathSimple(i, ref p) => {
2389+
hir::ViewPathSimple(name, ref p) => {
23902390
if !denied {
2391-
match inline::try_inline(cx, self.id, Some(i)) {
2391+
match inline::try_inline(cx, self.id, Some(name)) {
23922392
Some(items) => return items,
23932393
None => {}
23942394
}
23952395
}
2396-
(vec![], SimpleImport(i.clean(cx),
2396+
(vec![], SimpleImport(name.clean(cx),
23972397
resolve_use_source(cx, p.clean(cx), self.id)))
23982398
}
23992399
};

branches/tmp/src/librustdoc/doctree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,12 @@ pub struct DefaultImpl {
210210
}
211211

212212
pub struct Macro {
213-
pub name: Ident,
213+
pub name: Name,
214214
pub id: ast::NodeId,
215215
pub attrs: Vec<ast::Attribute>,
216216
pub whence: Span,
217217
pub stab: Option<attr::Stability>,
218-
pub imported_from: Option<Ident>,
218+
pub imported_from: Option<Name>,
219219
}
220220

221221
pub struct ExternCrate {

branches/tmp/src/librustdoc/visit_ast.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
199199

200200
}
201201

202-
fn resolve_id(&mut self, id: ast::NodeId, renamed: Option<ast::Ident>,
202+
fn resolve_id(&mut self, id: ast::NodeId, renamed: Option<ast::Name>,
203203
glob: bool, om: &mut Module, please_inline: bool) -> bool {
204204
let tcx = match self.cx.tcx_opt() {
205205
Some(tcx) => tcx,
@@ -241,9 +241,9 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
241241
}
242242

243243
pub fn visit_item(&mut self, item: &hir::Item,
244-
renamed: Option<ast::Ident>, om: &mut Module) {
244+
renamed: Option<ast::Name>, om: &mut Module) {
245245
debug!("Visiting item {:?}", item);
246-
let name = renamed.map_or(item.name, |x| x.name);
246+
let name = renamed.unwrap_or(item.name);
247247
match item.node {
248248
hir::ItemExternCrate(ref p) => {
249249
let path = match *p {
@@ -398,7 +398,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
398398
Macro {
399399
id: def.id,
400400
attrs: def.attrs.clone(),
401-
name: def.ident,
401+
name: def.name,
402402
whence: def.span,
403403
stab: self.stability(def.id),
404404
imported_from: def.imported_from,

0 commit comments

Comments
 (0)