diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index eeb832d48b0d..571f95064379 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; /// Gets a list of inner meta items from a list MetaItem type. - fn meta_item_list<'a>(&'a self) -> Option<&'a [P]>; + fn meta_item_list(&self) -> Option<&[P]>; fn span(&self) -> Span; } @@ -84,7 +84,7 @@ impl AttrMetaMethods for Attribute { fn value_str(&self) -> Option { self.meta().value_str() } - fn meta_item_list<'a>(&'a self) -> Option<&'a [P]> { + fn meta_item_list(&self) -> Option<&[P]> { 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]> { + fn meta_item_list(&self) -> Option<&[P]> { match self.node { MetaList(_, ref l) => Some(&l[..]), _ => None @@ -124,7 +124,7 @@ impl AttrMetaMethods for MetaItem { impl AttrMetaMethods for P { fn name(&self) -> InternedString { (**self).name() } fn value_str(&self) -> Option { (**self).value_str() } - fn meta_item_list<'a>(&'a self) -> Option<&'a [P]> { + fn meta_item_list(&self) -> Option<&[P]> { (**self).meta_item_list() } fn span(&self) -> Span { (**self).span() } @@ -132,14 +132,14 @@ impl AttrMetaMethods for P { pub trait AttributeMethods { - fn meta<'a>(&'a self) -> &'a MetaItem; + fn meta(&self) -> &MetaItem; fn with_desugared_doc(&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 e0ef8701cdff..3f925c9d7bae 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 d65e37fd2abc..9d53cb969269 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -58,7 +58,7 @@ impl SmallVector { 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 SmallVector { } } - 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],