Skip to content

Commit a351490

Browse files
---
yaml --- r: 179179 b: refs/heads/auto c: d58c0a7 h: refs/heads/master i: 179177: 3e3916f 179175: 3ece6f2 v: v3
1 parent df08150 commit a351490

File tree

25 files changed

+124
-105
lines changed

25 files changed

+124
-105
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 966e6c0c370317f06aa85248c17c7081d9736d99
13+
refs/heads/auto: d58c0a75978e068af8b01ab578b743c52635e1f4
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/ast.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ use std::fmt::Show;
6868
use std::num::Int;
6969
use std::rc::Rc;
7070
use serialize::{Encodable, Decodable, Encoder, Decoder};
71+
use std::ops::Deref;
7172

7273
// FIXME #6993: in librustc, uses of "ident" should be replaced
7374
// by just "Name".
@@ -112,13 +113,13 @@ impl fmt::Display for Ident {
112113
impl fmt::Debug for Name {
113114
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
114115
let Name(nm) = *self;
115-
write!(f, "{:?}({})", token::get_name(*self).get(), nm)
116+
write!(f, "{:?}({})", token::get_name(*self).deref(), nm)
116117
}
117118
}
118119

119120
impl fmt::Display for Name {
120121
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
121-
fmt::Display::fmt(token::get_name(*self).get(), f)
122+
fmt::Display::fmt(token::get_name(*self).deref(), f)
122123
}
123124
}
124125

@@ -174,7 +175,7 @@ impl Name {
174175
pub fn as_str<'a>(&'a self) -> &'a str {
175176
unsafe {
176177
// FIXME #12938: can't use copy_lifetime since &str isn't a &T
177-
::std::mem::transmute::<&str,&str>(token::get_name(*self).get())
178+
::std::mem::transmute::<&str,&str>(token::get_name(*self).deref())
178179
}
179180
}
180181

@@ -193,7 +194,7 @@ pub type Mrk = u32;
193194

194195
impl Encodable for Ident {
195196
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
196-
s.emit_str(token::get_ident(*self).get())
197+
s.emit_str(token::get_ident(*self).deref())
197198
}
198199
}
199200

branches/auto/src/libsyntax/ast_util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ use visit;
2323

2424
use std::cmp;
2525
use std::u32;
26+
use std::ops::Deref;
2627

2728
pub fn path_name_i(idents: &[Ident]) -> String {
2829
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
2930
idents.iter().map(|i| {
30-
token::get_ident(*i).get().to_string()
31+
token::get_ident(*i).deref().to_string()
3132
}).collect::<Vec<String>>().connect("::")
3233
}
3334

branches/auto/src/libsyntax/attr.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use std::cell::{RefCell, Cell};
2929
use std::collections::BitvSet;
3030
use std::collections::HashSet;
3131
use std::fmt;
32+
use std::ops::Deref;
3233

3334
thread_local! { static USED_ATTRS: RefCell<BitvSet> = RefCell::new(BitvSet::new()) }
3435

@@ -44,7 +45,7 @@ pub fn is_used(attr: &Attribute) -> bool {
4445

4546
pub trait AttrMetaMethods {
4647
fn check_name(&self, name: &str) -> bool {
47-
name == self.name().get()
48+
name == self.name().deref()
4849
}
4950

5051
/// Retrieve the name of the meta item, e.g. `foo` in `#[foo]`,
@@ -62,7 +63,7 @@ pub trait AttrMetaMethods {
6263

6364
impl AttrMetaMethods for Attribute {
6465
fn check_name(&self, name: &str) -> bool {
65-
let matches = name == self.name().get();
66+
let matches = name == self.name().deref();
6667
if matches {
6768
mark_used(self);
6869
}
@@ -142,7 +143,7 @@ impl AttributeMethods for Attribute {
142143
let meta = mk_name_value_item_str(
143144
InternedString::new("doc"),
144145
token::intern_and_get_ident(&strip_doc_comment_decoration(
145-
comment.get())[]));
146+
comment.deref())[]));
146147
if self.node.style == ast::AttrOuter {
147148
f(&mk_attr_outer(self.node.id, meta))
148149
} else {
@@ -209,7 +210,7 @@ pub fn mk_attr_outer(id: AttrId, item: P<MetaItem>) -> Attribute {
209210
pub fn mk_sugared_doc_attr(id: AttrId, text: InternedString, lo: BytePos,
210211
hi: BytePos)
211212
-> Attribute {
212-
let style = doc_comment_style(text.get());
213+
let style = doc_comment_style(text.deref());
213214
let lit = spanned(lo, hi, ast::LitStr(text, ast::CookedStr));
214215
let attr = Attribute_ {
215216
id: id,
@@ -326,11 +327,11 @@ pub fn requests_inline(attrs: &[Attribute]) -> bool {
326327
/// Tests if a cfg-pattern matches the cfg set
327328
pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::MetaItem) -> bool {
328329
match cfg.node {
329-
ast::MetaList(ref pred, ref mis) if pred.get() == "any" =>
330+
ast::MetaList(ref pred, ref mis) if pred.deref() == "any" =>
330331
mis.iter().any(|mi| cfg_matches(diagnostic, cfgs, &**mi)),
331-
ast::MetaList(ref pred, ref mis) if pred.get() == "all" =>
332+
ast::MetaList(ref pred, ref mis) if pred.deref() == "all" =>
332333
mis.iter().all(|mi| cfg_matches(diagnostic, cfgs, &**mi)),
333-
ast::MetaList(ref pred, ref mis) if pred.get() == "not" => {
334+
ast::MetaList(ref pred, ref mis) if pred.deref() == "not" => {
334335
if mis.len() != 1 {
335336
diagnostic.span_err(cfg.span, "expected 1 cfg-pattern");
336337
return false;
@@ -382,7 +383,7 @@ fn find_stability_generic<'a,
382383

383384
'outer: for attr in attrs {
384385
let tag = attr.name();
385-
let tag = tag.get();
386+
let tag = tag.deref();
386387
if tag != "deprecated" && tag != "unstable" && tag != "stable" {
387388
continue // not a stability level
388389
}
@@ -394,8 +395,8 @@ fn find_stability_generic<'a,
394395
let mut feature = None;
395396
let mut since = None;
396397
let mut reason = None;
397-
for meta in metas {
398-
if meta.name().get() == "feature" {
398+
for meta in metas.iter() {
399+
if meta.name() == "feature" {
399400
match meta.value_str() {
400401
Some(v) => feature = Some(v),
401402
None => {
@@ -404,7 +405,7 @@ fn find_stability_generic<'a,
404405
}
405406
}
406407
}
407-
if meta.name().get() == "since" {
408+
if meta.name().deref() == "since" {
408409
match meta.value_str() {
409410
Some(v) => since = Some(v),
410411
None => {
@@ -413,7 +414,7 @@ fn find_stability_generic<'a,
413414
}
414415
}
415416
}
416-
if meta.name().get() == "reason" {
417+
if meta.name().deref() == "reason" {
417418
match meta.value_str() {
418419
Some(v) => reason = Some(v),
419420
None => {
@@ -521,11 +522,11 @@ pub fn find_repr_attrs(diagnostic: &SpanHandler, attr: &Attribute) -> Vec<ReprAt
521522
for item in items {
522523
match item.node {
523524
ast::MetaWord(ref word) => {
524-
let hint = match word.get() {
525+
let hint = match word.deref() {
525526
// Can't use "extern" because it's not a lexical identifier.
526527
"C" => Some(ReprExtern),
527528
"packed" => Some(ReprPacked),
528-
_ => match int_type_of_word(word.get()) {
529+
_ => match int_type_of_word(word.deref()) {
529530
Some(ity) => Some(ReprInt(item.span, ity)),
530531
None => {
531532
// Not a word we recognize

branches/auto/src/libsyntax/diagnostics/plugin.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
use std::cell::RefCell;
1212
use std::collections::BTreeMap;
13+
use std::ops::Deref;
14+
1315
use ast;
1416
use ast::{Ident, Name, TokenTree};
1517
use codemap::Span;
@@ -57,7 +59,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
5759
match diagnostics.insert(code.name, span) {
5860
Some(previous_span) => {
5961
ecx.span_warn(span, &format!(
60-
"diagnostic code {} already used", token::get_ident(code).get()
62+
"diagnostic code {} already used", token::get_ident(code).deref()
6163
)[]);
6264
ecx.span_note(previous_span, "previous invocation");
6365
},
@@ -68,7 +70,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
6870
with_registered_diagnostics(|diagnostics| {
6971
if !diagnostics.contains_key(&code.name) {
7072
ecx.span_err(span, &format!(
71-
"used diagnostic code {} not registered", token::get_ident(code).get()
73+
"used diagnostic code {} not registered", token::get_ident(code).deref()
7274
)[]);
7375
}
7476
});
@@ -93,12 +95,12 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
9395
with_registered_diagnostics(|diagnostics| {
9496
if diagnostics.insert(code.name, description).is_some() {
9597
ecx.span_err(span, &format!(
96-
"diagnostic code {} already registered", token::get_ident(*code).get()
98+
"diagnostic code {} already registered", token::get_ident(*code).deref()
9799
)[]);
98100
}
99101
});
100102
let sym = Ident::new(token::gensym(&(
101-
"__register_diagnostic_".to_string() + token::get_ident(*code).get()
103+
"__register_diagnostic_".to_string() + token::get_ident(*code).deref()
102104
)[]));
103105
MacItems::new(vec![quote_item!(ecx, mod $sym {}).unwrap()].into_iter())
104106
}

branches/auto/src/libsyntax/ext/asm.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ use parse::token::InternedString;
2222
use parse::token;
2323
use ptr::P;
2424

25+
use std::ops::Deref;
26+
2527
enum State {
2628
Asm,
2729
Outputs,
@@ -102,7 +104,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
102104
// It's the opposite of '=&' which means that the memory
103105
// cannot be shared with any other operand (usually when
104106
// a register is clobbered early.)
105-
let output = match constraint.get().slice_shift_char() {
107+
let output = match constraint.deref().slice_shift_char() {
106108
Some(('=', _)) => None,
107109
Some(('+', operand)) => {
108110
Some(token::intern_and_get_ident(&format!(
@@ -129,9 +131,9 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
129131

130132
let (constraint, _str_style) = p.parse_str();
131133

132-
if constraint.get().starts_with("=") {
134+
if constraint.deref().starts_with("=") {
133135
cx.span_err(p.last_span, "input operand constraint contains '='");
134-
} else if constraint.get().starts_with("+") {
136+
} else if constraint.deref().starts_with("+") {
135137
cx.span_err(p.last_span, "input operand constraint contains '+'");
136138
}
137139

@@ -213,7 +215,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
213215
MacExpr::new(P(ast::Expr {
214216
id: ast::DUMMY_NODE_ID,
215217
node: ast::ExprInlineAsm(ast::InlineAsm {
216-
asm: token::intern_and_get_ident(asm.get()),
218+
asm: token::intern_and_get_ident(asm.deref()),
217219
asm_str_style: asm_str_style.unwrap(),
218220
outputs: outputs,
219221
inputs: inputs,

branches/auto/src/libsyntax/ext/base.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use fold::Folder;
2828

2929
use std::collections::HashMap;
3030
use std::rc::Rc;
31+
use std::ops::Deref;
3132

3233
pub trait ItemDecorator {
3334
fn expand(&self,
@@ -790,7 +791,7 @@ pub fn get_single_str_from_tts(cx: &mut ExtCtxt,
790791
cx.span_err(sp, &format!("{} takes 1 argument", name)[]);
791792
}
792793
expr_to_string(cx, ret, "argument must be a string literal").map(|(s, _)| {
793-
s.get().to_string()
794+
s.deref().to_string()
794795
})
795796
}
796797

branches/auto/src/libsyntax/ext/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use parse::token::InternedString;
2121
use parse::token;
2222
use ptr::P;
2323

24+
use std::ops::Deref;
2425

2526
// Transitional reexports so qquote can find the paths it is looking for
2627
mod syntax {
@@ -576,7 +577,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
576577
fn expr_field_access(&self, sp: Span, expr: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr> {
577578
let field_name = token::get_ident(ident);
578579
let field_span = Span {
579-
lo: sp.lo - Pos::from_usize(field_name.get().len()),
580+
lo: sp.lo - Pos::from_usize(field_name.deref().len()),
580581
hi: sp.hi,
581582
expn_id: sp.expn_id,
582583
};

branches/auto/src/libsyntax/ext/concat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use ext::build::AstBuilder;
1515
use parse::token;
1616

1717
use std::string::String;
18+
use std::ops::Deref;
1819

1920
pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
2021
sp: codemap::Span,
@@ -32,7 +33,7 @@ pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
3233
ast::LitStr(ref s, _) |
3334
ast::LitFloat(ref s, _) |
3435
ast::LitFloatUnsuffixed(ref s) => {
35-
accumulator.push_str(s.get());
36+
accumulator.push_str(s.deref());
3637
}
3738
ast::LitChar(c) => {
3839
accumulator.push(c);

branches/auto/src/libsyntax/ext/concat_idents.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ use parse::token;
1616
use parse::token::{str_to_ident};
1717
use ptr::P;
1818

19+
use std::ops::Deref;
20+
1921
pub fn expand_syntax_ext<'cx>(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
2022
-> Box<base::MacResult+'cx> {
2123
let mut res_str = String::new();
@@ -31,7 +33,7 @@ pub fn expand_syntax_ext<'cx>(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]
3133
} else {
3234
match *e {
3335
ast::TtToken(_, token::Ident(ident, _)) => {
34-
res_str.push_str(token::get_ident(ident).get())
36+
res_str.push_str(token::get_ident(ident).deref())
3537
},
3638
_ => {
3739
cx.span_err(sp, "concat_idents! requires ident args.");

branches/auto/src/libsyntax/ext/deriving/bounds.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use ext::deriving::generic::*;
1515
use ext::deriving::generic::ty::*;
1616
use ptr::P;
1717

18+
use std::ops::Deref;
19+
1820
pub fn expand_deriving_bound<F>(cx: &mut ExtCtxt,
1921
span: Span,
2022
mitem: &MetaItem,
@@ -24,7 +26,7 @@ pub fn expand_deriving_bound<F>(cx: &mut ExtCtxt,
2426
{
2527
let name = match mitem.node {
2628
MetaWord(ref tname) => {
27-
match tname.get() {
29+
match tname.deref() {
2830
"Copy" => "Copy",
2931
"Send" | "Sync" => {
3032
return cx.span_err(span,

branches/auto/src/libsyntax/ext/deriving/generic/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ use self::StructType::*;
189189

190190
use std::cell::RefCell;
191191
use std::vec;
192+
use std::ops::Deref;
192193

193194
use abi::Abi;
194195
use abi;
@@ -363,7 +364,7 @@ impl<'a> TraitDef<'a> {
363364
// generated implementations are linted
364365
let mut attrs = newitem.attrs.clone();
365366
attrs.extend(item.attrs.iter().filter(|a| {
366-
match a.name().get() {
367+
match a.name().deref() {
367368
"allow" | "warn" | "deny" | "forbid" => true,
368369
_ => false,
369370
}

branches/auto/src/libsyntax/ext/deriving/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use ext::base::ExtCtxt;
1818
use codemap::Span;
1919
use ptr::P;
2020

21+
use std::ops::Deref;
22+
2123
pub mod bounds;
2224
pub mod clone;
2325
pub mod encodable;
@@ -74,7 +76,7 @@ pub fn expand_meta_derive(cx: &mut ExtCtxt,
7476
|i| push(i)))
7577
}
7678

77-
match tname.get() {
79+
match tname.deref() {
7880
"Clone" => expand!(clone::expand_deriving_clone),
7981

8082
"Hash" => expand!(hash::expand_deriving_hash),

0 commit comments

Comments
 (0)