Skip to content

Commit 73cf885

Browse files
---
yaml --- r: 179181 b: refs/heads/auto c: 8b12d3d h: refs/heads/master i: 179179: a351490 v: v3
1 parent b9153e7 commit 73cf885

File tree

27 files changed

+94
-122
lines changed

27 files changed

+94
-122
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: 12f1f4c5467b0f4cbdb66c67eca7e5227dbb1284
13+
refs/heads/auto: 8b12d3ddf981e5450d8159b29db6ee2197064c8a
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ fn check_for_bindings_named_the_same_as_variants(cx: &MatchCheckCtxt, pat: &Pat)
249249
span_warn!(cx.tcx.sess, p.span, E0170,
250250
"pattern binding `{}` is named the same as one \
251251
of the variants of the type `{}`",
252-
token::get_ident(ident.node).get(), ty_to_string(cx.tcx, pat_ty));
252+
token::get_ident(&ident.node)[], ty_to_string(cx.tcx, pat_ty));
253253
span_help!(cx.tcx.sess, p.span,
254254
"if you meant to match on a variant, \
255255
consider making the path in the pattern qualified: `{}::{}`",
256-
ty_to_string(cx.tcx, pat_ty), token::get_ident(ident.node).get());
256+
ty_to_string(cx.tcx, pat_ty), &token::get_ident(ident.node)[]);
257257
}
258258
}
259259
}

branches/auto/src/librustc_back/svh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ mod svh_visitor {
329329
// macro invocations, namely macro_rules definitions,
330330
// *can* appear as items, even in the expanded crate AST.
331331

332-
if macro_name(mac).get() == "macro_rules" {
332+
if &macro_name(mac)[] == "macro_rules" {
333333
// Pretty-printing definition to a string strips out
334334
// surface artifacts (currently), such as the span
335335
// information, yielding a content-based hash.

branches/auto/src/libsyntax/ast.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ 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;
7271

7372
// FIXME #6993: in librustc, uses of "ident" should be replaced
7473
// by just "Name".
@@ -113,13 +112,13 @@ impl fmt::Display for Ident {
113112
impl fmt::Debug for Name {
114113
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
115114
let Name(nm) = *self;
116-
write!(f, "{:?}({})", token::get_name(*self).deref(), nm)
115+
write!(f, "{:?}({})", token::get_name(*self), nm)
117116
}
118117
}
119118

120119
impl fmt::Display for Name {
121120
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
122-
fmt::Display::fmt(token::get_name(*self).deref(), f)
121+
fmt::Display::fmt(&token::get_name(*self)[], f)
123122
}
124123
}
125124

@@ -175,7 +174,7 @@ impl Name {
175174
pub fn as_str<'a>(&'a self) -> &'a str {
176175
unsafe {
177176
// FIXME #12938: can't use copy_lifetime since &str isn't a &T
178-
::std::mem::transmute::<&str,&str>(token::get_name(*self).deref())
177+
::std::mem::transmute::<&str,&str>(&token::get_name(*self)[])
179178
}
180179
}
181180

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

195194
impl Encodable for Ident {
196195
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
197-
s.emit_str(token::get_ident(*self).deref())
196+
s.emit_str(&token::get_ident(*self)[])
198197
}
199198
}
200199

branches/auto/src/libsyntax/ast_util.rs

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

2424
use std::cmp;
2525
use std::u32;
26-
use std::ops::Deref;
2726

2827
pub fn path_name_i(idents: &[Ident]) -> String {
2928
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
3029
idents.iter().map(|i| {
31-
token::get_ident(*i).deref().to_string()
30+
token::get_ident(*i).to_string()
3231
}).collect::<Vec<String>>().connect("::")
3332
}
3433

branches/auto/src/libsyntax/attr.rs

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

3433
thread_local! { static USED_ATTRS: RefCell<BitvSet> = RefCell::new(BitvSet::new()) }
3534

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

4645
pub trait AttrMetaMethods {
4746
fn check_name(&self, name: &str) -> bool {
48-
name == self.name().deref()
47+
name == &self.name()[]
4948
}
5049

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

6463
impl AttrMetaMethods for Attribute {
6564
fn check_name(&self, name: &str) -> bool {
66-
let matches = name == self.name().deref();
65+
let matches = name == &self.name()[];
6766
if matches {
6867
mark_used(self);
6968
}
@@ -143,7 +142,7 @@ impl AttributeMethods for Attribute {
143142
let meta = mk_name_value_item_str(
144143
InternedString::new("doc"),
145144
token::intern_and_get_ident(&strip_doc_comment_decoration(
146-
comment.deref())[]));
145+
&comment[])[]));
147146
if self.node.style == ast::AttrOuter {
148147
f(&mk_attr_outer(self.node.id, meta))
149148
} else {
@@ -210,7 +209,7 @@ pub fn mk_attr_outer(id: AttrId, item: P<MetaItem>) -> Attribute {
210209
pub fn mk_sugared_doc_attr(id: AttrId, text: InternedString, lo: BytePos,
211210
hi: BytePos)
212211
-> Attribute {
213-
let style = doc_comment_style(text.deref());
212+
let style = doc_comment_style(&text[]);
214213
let lit = spanned(lo, hi, ast::LitStr(text, ast::CookedStr));
215214
let attr = Attribute_ {
216215
id: id,
@@ -327,11 +326,11 @@ pub fn requests_inline(attrs: &[Attribute]) -> bool {
327326
/// Tests if a cfg-pattern matches the cfg set
328327
pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::MetaItem) -> bool {
329328
match cfg.node {
330-
ast::MetaList(ref pred, ref mis) if pred.deref() == "any" =>
329+
ast::MetaList(ref pred, ref mis) if &pred[] == "any" =>
331330
mis.iter().any(|mi| cfg_matches(diagnostic, cfgs, &**mi)),
332-
ast::MetaList(ref pred, ref mis) if pred.deref() == "all" =>
331+
ast::MetaList(ref pred, ref mis) if &pred[] == "all" =>
333332
mis.iter().all(|mi| cfg_matches(diagnostic, cfgs, &**mi)),
334-
ast::MetaList(ref pred, ref mis) if pred.deref() == "not" => {
333+
ast::MetaList(ref pred, ref mis) if &pred[] == "not" => {
335334
if mis.len() != 1 {
336335
diagnostic.span_err(cfg.span, "expected 1 cfg-pattern");
337336
return false;
@@ -383,7 +382,7 @@ fn find_stability_generic<'a,
383382

384383
'outer: for attr in attrs {
385384
let tag = attr.name();
386-
let tag = tag.deref();
385+
let tag = &tag[];
387386
if tag != "deprecated" && tag != "unstable" && tag != "stable" {
388387
continue // not a stability level
389388
}
@@ -405,7 +404,7 @@ fn find_stability_generic<'a,
405404
}
406405
}
407406
}
408-
if meta.name().deref() == "since" {
407+
if &meta.name()[] == "since" {
409408
match meta.value_str() {
410409
Some(v) => since = Some(v),
411410
None => {
@@ -414,7 +413,7 @@ fn find_stability_generic<'a,
414413
}
415414
}
416415
}
417-
if meta.name().deref() == "reason" {
416+
if &meta.name()[] == "reason" {
418417
match meta.value_str() {
419418
Some(v) => reason = Some(v),
420419
None => {
@@ -522,11 +521,11 @@ pub fn find_repr_attrs(diagnostic: &SpanHandler, attr: &Attribute) -> Vec<ReprAt
522521
for item in items {
523522
match item.node {
524523
ast::MetaWord(ref word) => {
525-
let hint = match word.deref() {
524+
let hint = match &word[] {
526525
// Can't use "extern" because it's not a lexical identifier.
527526
"C" => Some(ReprExtern),
528527
"packed" => Some(ReprPacked),
529-
_ => match int_type_of_word(word.deref()) {
528+
_ => match int_type_of_word(&word[]) {
530529
Some(ity) => Some(ReprInt(item.span, ity)),
531530
None => {
532531
// Not a word we recognize

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

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

1111
use std::cell::RefCell;
1212
use std::collections::BTreeMap;
13-
use std::ops::Deref;
1413

1514
use ast;
1615
use ast::{Ident, Name, TokenTree};
@@ -59,7 +58,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
5958
match diagnostics.insert(code.name, span) {
6059
Some(previous_span) => {
6160
ecx.span_warn(span, &format!(
62-
"diagnostic code {} already used", token::get_ident(code).deref()
61+
"diagnostic code {} already used", &token::get_ident(code)[]
6362
)[]);
6463
ecx.span_note(previous_span, "previous invocation");
6564
},
@@ -70,7 +69,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
7069
with_registered_diagnostics(|diagnostics| {
7170
if !diagnostics.contains_key(&code.name) {
7271
ecx.span_err(span, &format!(
73-
"used diagnostic code {} not registered", token::get_ident(code).deref()
72+
"used diagnostic code {} not registered", &token::get_ident(code)[]
7473
)[]);
7574
}
7675
});
@@ -95,12 +94,12 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
9594
with_registered_diagnostics(|diagnostics| {
9695
if diagnostics.insert(code.name, description).is_some() {
9796
ecx.span_err(span, &format!(
98-
"diagnostic code {} already registered", token::get_ident(*code).deref()
97+
"diagnostic code {} already registered", &token::get_ident(*code)[]
9998
)[]);
10099
}
101100
});
102101
let sym = Ident::new(token::gensym(&(
103-
"__register_diagnostic_".to_string() + token::get_ident(*code).deref()
102+
"__register_diagnostic_".to_string() + &token::get_ident(*code)[]
104103
)[]));
105104
MacItems::new(vec![quote_item!(ecx, mod $sym {}).unwrap()].into_iter())
106105
}

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

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

25-
use std::ops::Deref;
26-
2725
enum State {
2826
Asm,
2927
Outputs,
@@ -104,7 +102,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
104102
// It's the opposite of '=&' which means that the memory
105103
// cannot be shared with any other operand (usually when
106104
// a register is clobbered early.)
107-
let output = match constraint.deref().slice_shift_char() {
105+
let output = match constraint.slice_shift_char() {
108106
Some(('=', _)) => None,
109107
Some(('+', operand)) => {
110108
Some(token::intern_and_get_ident(&format!(
@@ -131,9 +129,9 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
131129

132130
let (constraint, _str_style) = p.parse_str();
133131

134-
if constraint.deref().starts_with("=") {
132+
if constraint.starts_with("=") {
135133
cx.span_err(p.last_span, "input operand constraint contains '='");
136-
} else if constraint.deref().starts_with("+") {
134+
} else if constraint.starts_with("+") {
137135
cx.span_err(p.last_span, "input operand constraint contains '+'");
138136
}
139137

@@ -215,7 +213,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
215213
MacExpr::new(P(ast::Expr {
216214
id: ast::DUMMY_NODE_ID,
217215
node: ast::ExprInlineAsm(ast::InlineAsm {
218-
asm: token::intern_and_get_ident(asm.deref()),
216+
asm: token::intern_and_get_ident(&asm[]),
219217
asm_str_style: asm_str_style.unwrap(),
220218
outputs: outputs,
221219
inputs: inputs,

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

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

2929
use std::collections::HashMap;
3030
use std::rc::Rc;
31-
use std::ops::Deref;
3231

3332
pub trait ItemDecorator {
3433
fn expand(&self,
@@ -791,7 +790,7 @@ pub fn get_single_str_from_tts(cx: &mut ExtCtxt,
791790
cx.span_err(sp, &format!("{} takes 1 argument", name)[]);
792791
}
793792
expr_to_string(cx, ret, "argument must be a string literal").map(|(s, _)| {
794-
s.deref().to_string()
793+
s.to_string()
795794
})
796795
}
797796

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ use parse::token::InternedString;
2121
use parse::token;
2222
use ptr::P;
2323

24-
use std::ops::Deref;
25-
2624
// Transitional reexports so qquote can find the paths it is looking for
2725
mod syntax {
2826
pub use ext;
@@ -577,7 +575,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
577575
fn expr_field_access(&self, sp: Span, expr: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr> {
578576
let field_name = token::get_ident(ident);
579577
let field_span = Span {
580-
lo: sp.lo - Pos::from_usize(field_name.deref().len()),
578+
lo: sp.lo - Pos::from_usize(field_name.len()),
581579
hi: sp.hi,
582580
expn_id: sp.expn_id,
583581
};

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

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

1717
use std::string::String;
18-
use std::ops::Deref;
1918

2019
pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
2120
sp: codemap::Span,
@@ -33,7 +32,7 @@ pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
3332
ast::LitStr(ref s, _) |
3433
ast::LitFloat(ref s, _) |
3534
ast::LitFloatUnsuffixed(ref s) => {
36-
accumulator.push_str(s.deref());
35+
accumulator.push_str(&s[]);
3736
}
3837
ast::LitChar(c) => {
3938
accumulator.push(c);

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

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

19-
use std::ops::Deref;
20-
2119
pub fn expand_syntax_ext<'cx>(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
2220
-> Box<base::MacResult+'cx> {
2321
let mut res_str = String::new();
@@ -33,7 +31,7 @@ pub fn expand_syntax_ext<'cx>(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]
3331
} else {
3432
match *e {
3533
ast::TtToken(_, token::Ident(ident, _)) => {
36-
res_str.push_str(token::get_ident(ident).deref())
34+
res_str.push_str(&token::get_ident(ident)[])
3735
},
3836
_ => {
3937
cx.span_err(sp, "concat_idents! requires ident args.");

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

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

18-
use std::ops::Deref;
19-
2018
pub fn expand_deriving_bound<F>(cx: &mut ExtCtxt,
2119
span: Span,
2220
mitem: &MetaItem,
@@ -26,7 +24,7 @@ pub fn expand_deriving_bound<F>(cx: &mut ExtCtxt,
2624
{
2725
let name = match mitem.node {
2826
MetaWord(ref tname) => {
29-
match tname.deref() {
27+
match &tname[] {
3028
"Copy" => "Copy",
3129
"Send" | "Sync" => {
3230
return cx.span_err(span,

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

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

190190
use std::cell::RefCell;
191191
use std::vec;
192-
use std::ops::Deref;
193192

194193
use abi::Abi;
195194
use abi;
@@ -364,7 +363,7 @@ impl<'a> TraitDef<'a> {
364363
// generated implementations are linted
365364
let mut attrs = newitem.attrs.clone();
366365
attrs.extend(item.attrs.iter().filter(|a| {
367-
match a.name().deref() {
366+
match &a.name()[] {
368367
"allow" | "warn" | "deny" | "forbid" => true,
369368
_ => false,
370369
}

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

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

21-
use std::ops::Deref;
22-
2321
pub mod bounds;
2422
pub mod clone;
2523
pub mod encodable;
@@ -76,7 +74,7 @@ pub fn expand_meta_derive(cx: &mut ExtCtxt,
7674
|i| push(i)))
7775
}
7876

79-
match tname.deref() {
77+
match &tname[] {
8078
"Clone" => expand!(clone::expand_deriving_clone),
8179

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

0 commit comments

Comments
 (0)