diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 15:48:40 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-18 15:48:40 -0800 |
| commit | 231eeaa35b3a7700cfd05dcb30f01cd7a36313b8 (patch) | |
| tree | 83644afe1c67870e2f015abfc834307aa532dec7 /src/libsyntax/ast_map | |
| parent | 2cdbd288ac0606902885434e1ccd8d8bde68913d (diff) | |
| parent | 9ea84aeed4ed3006eddb6a7b24e9714f2844cd22 (diff) | |
| download | rust-231eeaa35b3a7700cfd05dcb30f01cd7a36313b8.tar.gz rust-231eeaa35b3a7700cfd05dcb30f01cd7a36313b8.zip | |
rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
Diffstat (limited to 'src/libsyntax/ast_map')
| -rw-r--r-- | src/libsyntax/ast_map/mod.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index 6535705388d..ba08f61b557 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -86,7 +86,7 @@ pub fn path_to_string<PI: Iterator<Item=PathElem>>(path: PI) -> String { if !s.is_empty() { s.push_str("::"); } - s.push_str(&e[]); + s.push_str(&e[..]); s }) } @@ -463,20 +463,20 @@ impl<'ast> Map<'ast> { F: FnOnce(Option<&[Attribute]>) -> T, { let attrs = match self.get(id) { - NodeItem(i) => Some(&i.attrs[]), - NodeForeignItem(fi) => Some(&fi.attrs[]), + NodeItem(i) => Some(&i.attrs[..]), + NodeForeignItem(fi) => Some(&fi.attrs[..]), NodeTraitItem(ref tm) => match **tm { - RequiredMethod(ref type_m) => Some(&type_m.attrs[]), - ProvidedMethod(ref m) => Some(&m.attrs[]), - TypeTraitItem(ref typ) => Some(&typ.attrs[]), + RequiredMethod(ref type_m) => Some(&type_m.attrs[..]), + ProvidedMethod(ref m) => Some(&m.attrs[..]), + TypeTraitItem(ref typ) => Some(&typ.attrs[..]), }, NodeImplItem(ref ii) => { match **ii { - MethodImplItem(ref m) => Some(&m.attrs[]), - TypeImplItem(ref t) => Some(&t.attrs[]), + MethodImplItem(ref m) => Some(&m.attrs[..]), + TypeImplItem(ref t) => Some(&t.attrs[..]), } } - NodeVariant(ref v) => Some(&v.node.attrs[]), + NodeVariant(ref v) => Some(&v.node.attrs[..]), // unit/tuple structs take the attributes straight from // the struct definition. // FIXME(eddyb) make this work again (requires access to the map). @@ -577,7 +577,7 @@ impl<'a, 'ast> NodesMatchingSuffix<'a, 'ast> { None => return false, Some((node_id, name)) => (node_id, name), }; - if &part[] != mod_name.as_str() { + if &part[..] != mod_name.as_str() { return false; } cursor = self.map.get_parent(mod_id); @@ -615,7 +615,7 @@ impl<'a, 'ast> NodesMatchingSuffix<'a, 'ast> { // We are looking at some node `n` with a given name and parent // id; do their names match what I am seeking? fn matches_names(&self, parent_of_n: NodeId, name: Name) -> bool { - name.as_str() == &self.item_name[] && + name.as_str() == &self.item_name[..] && self.suffix_matches(parent_of_n) } } @@ -1026,7 +1026,7 @@ impl<'a> NodePrinter for pprust::State<'a> { fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String { let id_str = format!(" (id={})", id); - let id_str = if include_id { &id_str[] } else { "" }; + let id_str = if include_id { &id_str[..] } else { "" }; match map.find(id) { Some(NodeItem(item)) => { |
