Skip to content

Commit dfc314d

Browse files
committed
Use lifetime elision
1 parent 791003a commit dfc314d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/libsyntax/attr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub trait AttrMetaMethods {
6767
/// containing a string, otherwise None.
6868
fn value_str(&self) -> Option<InternedString>;
6969
/// Gets a list of inner meta items from a list MetaItem type.
70-
fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]>;
70+
fn meta_item_list(&self) -> Option<&[P<MetaItem>]>;
7171

7272
fn span(&self) -> Span;
7373
}
@@ -84,7 +84,7 @@ impl AttrMetaMethods for Attribute {
8484
fn value_str(&self) -> Option<InternedString> {
8585
self.meta().value_str()
8686
}
87-
fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> {
87+
fn meta_item_list(&self) -> Option<&[P<MetaItem>]> {
8888
self.node.value.meta_item_list()
8989
}
9090
fn span(&self) -> Span { self.meta().span }
@@ -111,7 +111,7 @@ impl AttrMetaMethods for MetaItem {
111111
}
112112
}
113113

114-
fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> {
114+
fn meta_item_list(&self) -> Option<&[P<MetaItem>]> {
115115
match self.node {
116116
MetaList(_, ref l) => Some(&l[..]),
117117
_ => None
@@ -124,22 +124,22 @@ impl AttrMetaMethods for MetaItem {
124124
impl AttrMetaMethods for P<MetaItem> {
125125
fn name(&self) -> InternedString { (**self).name() }
126126
fn value_str(&self) -> Option<InternedString> { (**self).value_str() }
127-
fn meta_item_list<'a>(&'a self) -> Option<&'a [P<MetaItem>]> {
127+
fn meta_item_list(&self) -> Option<&[P<MetaItem>]> {
128128
(**self).meta_item_list()
129129
}
130130
fn span(&self) -> Span { (**self).span() }
131131
}
132132

133133

134134
pub trait AttributeMethods {
135-
fn meta<'a>(&'a self) -> &'a MetaItem;
135+
fn meta(&self) -> &MetaItem;
136136
fn with_desugared_doc<T, F>(&self, f: F) -> T where
137137
F: FnOnce(&Attribute) -> T;
138138
}
139139

140140
impl AttributeMethods for Attribute {
141141
/// Extract the MetaItem from inside this Attribute.
142-
fn meta<'a>(&'a self) -> &'a MetaItem {
142+
fn meta(&self) -> &MetaItem {
143143
&*self.node.value
144144
}
145145

src/libsyntax/ext/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ impl SyntaxEnv {
881881
self.chain.pop();
882882
}
883883

884-
fn find_escape_frame<'a>(&'a mut self) -> &'a mut MapChainFrame {
884+
fn find_escape_frame(&mut self) -> &mut MapChainFrame {
885885
for (i, frame) in self.chain.iter_mut().enumerate().rev() {
886886
if !frame.info.macros_escape || i == 0 {
887887
return frame
@@ -904,7 +904,7 @@ impl SyntaxEnv {
904904
self.find_escape_frame().map.insert(k, Rc::new(v));
905905
}
906906

907-
pub fn info<'a>(&'a mut self) -> &'a mut BlockInfo {
907+
pub fn info(&mut self) -> &mut BlockInfo {
908908
let last_chain_index = self.chain.len() - 1;
909909
&mut self.chain[last_chain_index].info
910910
}

src/libsyntax/util/small_vector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<T> SmallVector<T> {
5858
SmallVector { repr: Many(vs) }
5959
}
6060

61-
pub fn as_slice<'a>(&'a self) -> &'a [T] {
61+
pub fn as_slice(&self) -> &[T] {
6262
match self.repr {
6363
Zero => {
6464
let result: &[T] = &[];
@@ -105,7 +105,7 @@ impl<T> SmallVector<T> {
105105
}
106106
}
107107

108-
pub fn get<'a>(&'a self, idx: usize) -> &'a T {
108+
pub fn get(&self, idx: usize) -> &T {
109109
match self.repr {
110110
One(ref v) if idx == 0 => v,
111111
Many(ref vs) => &vs[idx],

0 commit comments

Comments
 (0)