Skip to content

Commit 9f24dd7

Browse files
committed
---
yaml --- r: 123683 b: refs/heads/try c: 6007797 h: refs/heads/master i: 123681: b9f610f 123679: 7309e87 v: v3
1 parent 7ce08b8 commit 9f24dd7

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: da4e4e4e0a7778a85748aa4a303b13f603e96b4b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8ddd286ea4ba4384a0dc9eae393ed515460a986e
5-
refs/heads/try: c1b8b3c35c1e59c475412864c230491843b52ab1
5+
refs/heads/try: 6007797ed6f712576bccac799d0fc79a2eb61ae7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/resolve.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use syntax::ast;
2525
use syntax::ast_util::{local_def};
2626
use syntax::ast_util::{walk_pat, trait_method_to_ty_method};
2727
use syntax::ext::mtwt;
28+
use syntax::parse::token::special_names;
2829
use syntax::parse::token::special_idents;
2930
use syntax::parse::token;
3031
use syntax::codemap::{Span, DUMMY_SP, Pos};
@@ -830,9 +831,9 @@ struct Resolver<'a> {
830831
current_self_type: Option<Ty>,
831832

832833
// The ident for the keyword "self".
833-
self_ident: Ident,
834+
self_name: Name,
834835
// The ident for the non-keyword "Self".
835-
type_self_ident: Ident,
836+
type_self_name: Name,
836837

837838
// The idents for the primitive types.
838839
primitive_type_table: PrimitiveTypeTable,
@@ -926,8 +927,8 @@ impl<'a> Resolver<'a> {
926927
current_trait_ref: None,
927928
current_self_type: None,
928929

929-
self_ident: special_idents::self_,
930-
type_self_ident: special_idents::type_self,
930+
self_name: special_names::self_,
931+
type_self_name: special_names::type_self,
931932

932933
primitive_type_table: PrimitiveTypeTable::new(),
933934

@@ -3628,8 +3629,8 @@ impl<'a> Resolver<'a> {
36283629
// Create a new rib for the self type.
36293630
let self_type_rib = Rib::new(ItemRibKind);
36303631

3631-
// plain insert (no renaming)
3632-
let name = self.type_self_ident.name;
3632+
// plain insert (no renaming, types are not currently hygienic....)
3633+
let name = self.type_self_name;
36333634
self_type_rib.bindings.borrow_mut()
36343635
.insert(name, DlDef(DefSelfTy(item.id)));
36353636
self.type_ribs.borrow_mut().push(self_type_rib);
@@ -5159,8 +5160,8 @@ impl<'a> Resolver<'a> {
51595160
false // Stop advancing
51605161
});
51615162

5162-
if method_scope && token::get_name(self.self_ident.name).get()
5163-
== wrong_name.as_slice() {
5163+
if method_scope && token::get_name(self.self_name).get()
5164+
== wrong_name.as_slice() {
51645165
self.resolve_error(
51655166
expr.span,
51665167
"`self` is not available \
@@ -5532,6 +5533,7 @@ impl<'a> Resolver<'a> {
55325533
collect_mod(idents, &*module.upgrade().unwrap());
55335534
}
55345535
BlockParentLink(ref module, _) => {
5536+
// danger, shouldn't be ident?
55355537
idents.push(special_idents::opaque);
55365538
collect_mod(idents, &*module.upgrade().unwrap());
55375539
}

branches/try/src/libsyntax/parse/token.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ macro_rules! declare_special_idents_and_keywords {(
405405
$( pub static $si_static: Ident = Ident { name: $si_name, ctxt: 0 }; )*
406406
}
407407

408+
pub mod special_names {
409+
use ast::Name;
410+
$( pub static $si_static: Name = $si_name; )*
411+
}
412+
408413
/**
409414
* All the valid words that have meaning in the Rust language.
410415
*

0 commit comments

Comments
 (0)