Skip to content

Commit 56b5d57

Browse files
committed
---
yaml --- r: 236582 b: refs/heads/tmp c: f284cbc h: refs/heads/master v: v3
1 parent 940026c commit 56b5d57

File tree

43 files changed

+196
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+196
-255
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: 40ce80484c636e525ac796a81f38a96c0ca8bf09
28+
refs/heads/tmp: f284cbc7af06a941de0cdd06291dc78d37268b9f
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/grammar/verify.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use syntax::parse::lexer::TokenAndSpan;
3535

3636
fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
3737
fn id() -> token::Token {
38-
token::Ident(ast::Ident { name: Name(0), ctxt: 0, }, token::Plain)
38+
token::Ident(ast::Ident::with_empty_ctxt(Name(0))), token::Plain)
3939
}
4040

4141
let mut res = HashMap::new();
@@ -75,7 +75,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
7575
"RPAREN" => token::CloseDelim(token::Paren),
7676
"SLASH" => token::BinOp(token::Slash),
7777
"COMMA" => token::Comma,
78-
"LIFETIME" => token::Lifetime(ast::Ident { name: Name(0), ctxt: 0 }),
78+
"LIFETIME" => token::Lifetime(ast::Ident::with_empty_ctxt(Name(0))),
7979
"CARET" => token::BinOp(token::Caret),
8080
"TILDE" => token::Tilde,
8181
"IDENT" => id(),
@@ -208,9 +208,9 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
208208
token::Literal(token::ByteStr(..), n) => token::Literal(token::ByteStr(nm), n),
209209
token::Literal(token::ByteStrRaw(..), n) => token::Literal(token::ByteStrRaw(fix(content),
210210
count(content)), n),
211-
token::Ident(..) => token::Ident(ast::Ident { name: nm, ctxt: 0 },
211+
token::Ident(..) => token::Ident(ast::Ident::with_empty_ctxt(nm)),
212212
token::ModName),
213-
token::Lifetime(..) => token::Lifetime(ast::Ident { name: nm, ctxt: 0 }),
213+
token::Lifetime(..) => token::Lifetime(ast::Ident::with_empty_ctxt(nm)),
214214
ref t => t.clone()
215215
};
216216

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ impl<'a> CrateReader<'a> {
482482
let span = mk_sp(lo, p.last_span.hi);
483483
p.abort_if_errors();
484484
macros.push(ast::MacroDef {
485-
ident: name.ident(),
485+
ident: ast::Ident::with_empty_ctxt(name),
486486
attrs: attrs,
487487
id: ast::DUMMY_NODE_ID,
488488
span: span,

branches/tmp/src/librustc/middle/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
8585
EntryPointType::Start
8686
} else if attr::contains_name(&item.attrs, "main") {
8787
EntryPointType::MainAttr
88-
} else if item.name == "main" {
88+
} else if item.name.as_str() == "main" {
8989
if depth == 1 {
9090
// This is a top-level function so can be 'main'
9191
EntryPointType::MainNamed

branches/tmp/src/librustc/middle/intrinsicck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> {
5555
ty::TyBareFn(_, ref bfty) => bfty.abi == RustIntrinsic,
5656
_ => return false
5757
};
58-
intrinsic && self.tcx.item_name(def_id) == "transmute"
58+
intrinsic && self.tcx.item_name(def_id).as_str() == "transmute"
5959
}
6060

6161
fn check_transmute(&self, span: Span, from: Ty<'tcx>, to: Ty<'tcx>, id: ast::NodeId) {

branches/tmp/src/librustc/middle/pat_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub fn def_to_path(tcx: &ty::ctxt, id: DefId) -> hir::Path {
211211
tcx.with_path(id, |path| hir::Path {
212212
global: false,
213213
segments: path.last().map(|elem| hir::PathSegment {
214-
identifier: ast::Ident::new(elem.name()),
214+
identifier: ast::Ident::with_empty_ctxt(elem.name()),
215215
parameters: hir::PathParameters::none(),
216216
}).into_iter().collect(),
217217
span: DUMMY_SP,

branches/tmp/src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Checker<'a, 'tcx> {
336336
// When compiling with --test we don't enforce stability on the
337337
// compiler-generated test module, demarcated with `DUMMY_SP` plus the
338338
// name `__test`
339-
if item.span == DUMMY_SP && item.name == "__test" { return }
339+
if item.span == DUMMY_SP && item.name.as_str() == "__test" { return }
340340

341341
check_item(self.tcx, item, true,
342342
&mut |id, sp, stab| self.check(id, sp, stab));

branches/tmp/src/librustc_borrowck/borrowck/gather_loans/move_error.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc::middle::ty;
1515
use std::cell::RefCell;
1616
use syntax::ast;
1717
use syntax::codemap;
18-
use rustc_front::print::pprust;
1918
use rustc_front::hir;
2019

2120
pub struct MoveErrorCollector<'tcx> {
@@ -159,7 +158,6 @@ fn note_move_destination(bccx: &BorrowckCtxt,
159158
move_to_span: codemap::Span,
160159
pat_name: ast::Name,
161160
is_first_note: bool) {
162-
let pat_name = pprust::name_to_string(pat_name);
163161
if is_first_note {
164162
bccx.span_note(
165163
move_to_span,

branches/tmp/src/librustc_driver/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ impl<'ast> pprust::PpAnn for HygieneAnnotation<'ast> {
380380
try!(pp::space(&mut s.s));
381381
// FIXME #16420: this doesn't display the connections
382382
// between syntax contexts
383-
s.synth_comment(format!("{}#{}", nm, ctxt))
383+
s.synth_comment(format!("{}#{}", nm, ctxt.0))
384384
}
385385
pprust::NodeName(&ast::Name(nm)) => {
386386
try!(pp::space(&mut s.s));

branches/tmp/src/librustc_front/hir.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,15 +631,13 @@ pub enum Expr_ {
631631
///
632632
/// `if expr { block } else { expr }`
633633
ExprIf(P<Expr>, P<Block>, Option<P<Expr>>),
634-
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
635634
/// A while loop, with an optional label
636635
///
637636
/// `'label: while expr { block }`
638637
ExprWhile(P<Expr>, P<Block>, Option<Ident>),
639638
/// Conditionless loop (can be exited with break, continue, or return)
640639
///
641640
/// `'label: loop { block }`
642-
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
643641
ExprLoop(P<Block>, Option<Ident>),
644642
/// A `match` block, with a source that indicates whether or not it is
645643
/// the result of a desugaring, and if so, which kind.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,6 @@ impl<'a> State<'a> {
21712171
hir::ViewPathSimple(name, ref path) => {
21722172
try!(self.print_path(path, false, 0));
21732173

2174-
// FIXME(#6993) can't compare identifiers directly here
21752174
if path.segments.last().unwrap().identifier.name != name {
21762175
try!(space(&mut self.s));
21772176
try!(self.word_space("as"));

branches/tmp/src/librustc_lint/unused.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl UnusedMut {
5050
let name = path1.node;
5151
if let hir::BindByValue(hir::MutMutable) = mode {
5252
if !name.as_str().starts_with("_") {
53-
match mutables.entry(name.usize()) {
53+
match mutables.entry(name.0 as usize) {
5454
Vacant(entry) => { entry.insert(vec![id]); },
5555
Occupied(mut entry) => { entry.get_mut().push(id); },
5656
}

branches/tmp/src/librustc_resolve/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3710,7 +3710,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
37103710
false // Stop advancing
37113711
});
37123712

3713-
if method_scope && special_names::self_ == path_name {
3713+
if method_scope && special_names::self_.as_str() == &path_name[..] {
37143714
resolve_error(
37153715
self,
37163716
expr.span,

branches/tmp/src/librustc_resolve/resolve_imports.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
537537
fn get_binding(this: &mut Resolver,
538538
import_resolution: &ImportResolution,
539539
namespace: Namespace,
540-
source: &Name)
540+
source: Name)
541541
-> NamespaceResult {
542542

543543
// Import resolutions must be declared with "pub"
@@ -560,7 +560,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
560560
let id = import_resolution.id(namespace);
561561
// track used imports and extern crates as well
562562
this.used_imports.insert((id, namespace));
563-
this.record_import_use(id, *source);
563+
this.record_import_use(id, source);
564564
match target_module.def_id.get() {
565565
Some(DefId{krate: kid, ..}) => {
566566
this.used_crates.insert(kid);
@@ -578,14 +578,14 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
578578
value_result = get_binding(self.resolver,
579579
import_resolution,
580580
ValueNS,
581-
&source);
581+
source);
582582
value_used_reexport = import_resolution.is_public;
583583
}
584584
if type_result.is_unknown() {
585585
type_result = get_binding(self.resolver,
586586
import_resolution,
587587
TypeNS,
588-
&source);
588+
source);
589589
type_used_reexport = import_resolution.is_public;
590590
}
591591

branches/tmp/src/librustc_trans/save/dump_csv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> {
444444

445445
fn process_const(&mut self,
446446
id: ast::NodeId,
447-
name: &ast::Name,
447+
name: ast::Name,
448448
span: Span,
449449
typ: &ast::Ty,
450450
expr: &ast::Expr) {
@@ -988,7 +988,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
988988
fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
989989
match trait_item.node {
990990
ast::ConstTraitItem(ref ty, Some(ref expr)) => {
991-
self.process_const(trait_item.id, &trait_item.ident.name,
991+
self.process_const(trait_item.id, trait_item.ident.name,
992992
trait_item.span, &*ty, &*expr);
993993
}
994994
ast::MethodTraitItem(ref sig, ref body) => {
@@ -1006,7 +1006,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> {
10061006
fn visit_impl_item(&mut self, impl_item: &ast::ImplItem) {
10071007
match impl_item.node {
10081008
ast::ConstImplItem(ref ty, ref expr) => {
1009-
self.process_const(impl_item.id, &impl_item.ident.name,
1009+
self.process_const(impl_item.id, impl_item.ident.name,
10101010
impl_item.span, &ty, &expr);
10111011
}
10121012
ast::MethodImplItem(ref sig, ref body) => {

branches/tmp/src/librustc_trans/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn return_type_is_void(ccx: &CrateContext, ty: Ty) -> bool {
168168
/// Generates a unique symbol based off the name given. This is used to create
169169
/// unique symbols for things like closures.
170170
pub fn gensym_name(name: &str) -> PathElem {
171-
let num = token::gensym(name).usize();
171+
let num = token::gensym(name).0;
172172
// use one colon which will get translated to a period by the mangler, and
173173
// we're guaranteed that `num` is globally unique for this crate.
174174
PathName(token::gensym(&format!("{}:{}", name, num)))
@@ -829,7 +829,7 @@ pub fn C_cstr(cx: &CrateContext, s: InternedString, null_terminated: bool) -> Va
829829
!null_terminated as Bool);
830830

831831
let gsym = token::gensym("str");
832-
let sym = format!("str{}", gsym.usize());
832+
let sym = format!("str{}", gsym.0);
833833
let g = declare::define_global(cx, &sym[..], val_ty(sc)).unwrap_or_else(||{
834834
cx.sess().bug(&format!("symbol `{}` is already defined", sym));
835835
});

branches/tmp/src/librustc_trans/trans/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn addr_of_mut(ccx: &CrateContext,
116116
// FIXME: this totally needs a better name generation scheme, perhaps a simple global
117117
// counter? Also most other uses of gensym in trans.
118118
let gsym = token::gensym("_");
119-
let name = format!("{}{}", kind, gsym.usize());
119+
let name = format!("{}{}", kind, gsym.0);
120120
let gv = declare::define_global(ccx, &name[..], val_ty(cv)).unwrap_or_else(||{
121121
ccx.sess().bug(&format!("symbol `{}` is already defined", name));
122122
});

branches/tmp/src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ fn check_trait_on_unimplemented<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
838838
Position::ArgumentNamed(s) if s == "Self" => (),
839839
// So is `{A}` if A is a type parameter
840840
Position::ArgumentNamed(s) => match types.iter().find(|t| {
841-
t.name == s
841+
t.name.as_str() == s
842842
}) {
843843
Some(_) => (),
844844
None => {

0 commit comments

Comments
 (0)