about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2015-11-10 20:42:00 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2015-11-10 20:42:00 +0900
commitdfc314d19b584b0631ab787b613a55f2a73ebe45 (patch)
tree2241ceba79df957774b6fe69f25cffd9ce625f72 /src/libsyntax
parent791003ad3c014c1ca12a29d35b4f8530aa4b7b76 (diff)
downloadrust-dfc314d19b584b0631ab787b613a55f2a73ebe45.tar.gz
rust-dfc314d19b584b0631ab787b613a55f2a73ebe45.zip
Use lifetime elision
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/attr.rs12
-rw-r--r--src/libsyntax/ext/base.rs4
-rw-r--r--src/libsyntax/util/small_vector.rs4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index eeb832d48b0..571f9506437 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -67,7 +67,7 @@ pub trait AttrMetaMethods {
     /// containing a string, otherwise None.
     fn value_str(&self) -> Option<InternedString>;
     /// Gets a list of inner meta items from a list MetaItem type.
-    fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]>;
+    fn meta_item_list(&self) -> Option<&[P<MetaItem>]>;
 
     fn span(&self) -> Span;
 }
@@ -84,7 +84,7 @@ impl AttrMetaMethods for Attribute {
     fn value_str(&self) -> Option<InternedString> {
         self.meta().value_str()
     }
-    fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> {
+    fn meta_item_list(&self) -> Option<&[P<MetaItem>]> {
         self.node.value.meta_item_list()
     }
     fn span(&self) -> Span { self.meta().span }
@@ -111,7 +111,7 @@ impl AttrMetaMethods for MetaItem {
         }
     }
 
-    fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> {
+    fn meta_item_list(&self) -> Option<&[P<MetaItem>]> {
         match self.node {
             MetaList(_, ref l) => Some(&l[..]),
             _ => None
@@ -124,7 +124,7 @@ impl AttrMetaMethods for MetaItem {
 impl AttrMetaMethods for P<MetaItem> {
     fn name(&self) -> InternedString { (**self).name() }
     fn value_str(&self) -> Option<InternedString> { (**self).value_str() }
-    fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> {
+    fn meta_item_list(&self) -> Option<&[P<MetaItem>]> {
         (**self).meta_item_list()
     }
     fn span(&self) -> Span { (**self).span() }
@@ -132,14 +132,14 @@ impl AttrMetaMethods for P<MetaItem> {
 
 
 pub trait AttributeMethods {
-    fn meta<'a>(&'a self) -> &'a MetaItem;
+    fn meta(&self) -> &MetaItem;
     fn with_desugared_doc<T, F>(&self, f: F) -> T where
         F: FnOnce(&Attribute) -> T;
 }
 
 impl AttributeMethods for Attribute {
     /// Extract the MetaItem from inside this Attribute.
-    fn meta<'a>(&'a self) -> &'a MetaItem {
+    fn meta(&self) -> &MetaItem {
         &*self.node.value
     }
 
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index e0ef8701cdf..3f925c9d7ba 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -881,7 +881,7 @@ impl SyntaxEnv {
         self.chain.pop();
     }
 
-    fn find_escape_frame<'a>(&'a mut self) -> &'a mut MapChainFrame {
+    fn find_escape_frame(&mut self) -> &mut MapChainFrame {
         for (i, frame) in self.chain.iter_mut().enumerate().rev() {
             if !frame.info.macros_escape || i == 0 {
                 return frame
@@ -904,7 +904,7 @@ impl SyntaxEnv {
         self.find_escape_frame().map.insert(k, Rc::new(v));
     }
 
-    pub fn info<'a>(&'a mut self) -> &'a mut BlockInfo {
+    pub fn info(&mut self) -> &mut BlockInfo {
         let last_chain_index = self.chain.len() - 1;
         &mut self.chain[last_chain_index].info
     }
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs
index d65e37fd2ab..9d53cb96926 100644
--- a/src/libsyntax/util/small_vector.rs
+++ b/src/libsyntax/util/small_vector.rs
@@ -58,7 +58,7 @@ impl<T> SmallVector<T> {
         SmallVector { repr: Many(vs) }
     }
 
-    pub fn as_slice<'a>(&'a self) -> &'a [T] {
+    pub fn as_slice(&self) -> &[T] {
         match self.repr {
             Zero => {
                 let result: &[T] = &[];
@@ -105,7 +105,7 @@ impl<T> SmallVector<T> {
         }
     }
 
-    pub fn get<'a>(&'a self, idx: usize) -> &'a T {
+    pub fn get(&self, idx: usize) -> &T {
         match self.repr {
             One(ref v) if idx == 0 => v,
             Many(ref vs) => &vs[idx],