Skip to content

Commit 88c515d

Browse files
committed
Revert changes to the standard library
Moved to its own PR
1 parent edcde70 commit 88c515d

File tree

16 files changed

+25
-25
lines changed

16 files changed

+25
-25
lines changed

src/liballoc/collections/btree/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ impl<K, V> BTreeMap<K, V> {
20042004
/// assert_eq!(keys, [1, 2]);
20052005
/// ```
20062006
#[stable(feature = "rust1", since = "1.0.0")]
2007-
pub fn keys(&self) -> Keys<'_, K, V> {
2007+
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
20082008
Keys { inner: self.iter() }
20092009
}
20102010

@@ -2025,7 +2025,7 @@ impl<K, V> BTreeMap<K, V> {
20252025
/// assert_eq!(values, ["hello", "goodbye"]);
20262026
/// ```
20272027
#[stable(feature = "rust1", since = "1.0.0")]
2028-
pub fn values(&self) -> Values<'_, K, V> {
2028+
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
20292029
Values { inner: self.iter() }
20302030
}
20312031

@@ -2529,8 +2529,8 @@ enum UnderflowResult<'a, K, V> {
25292529
Stole(NodeRef<marker::Mut<'a>, K, V, marker::Internal>),
25302530
}
25312531

2532-
fn handle_underfull_node<K, V>(node: NodeRef<marker::Mut<'_>, K, V, marker::LeafOrInternal>)
2533-
-> UnderflowResult<'_, K, V> {
2532+
fn handle_underfull_node<'a, K, V>(node: NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>)
2533+
-> UnderflowResult<'a, K, V> {
25342534
let parent = if let Ok(parent) = node.ascend() {
25352535
parent
25362536
} else {

src/liballoc/collections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
394394
}
395395

396396
/// Temporarily takes out another, immutable reference to the same node.
397-
fn reborrow(&self) -> NodeRef<marker::Immut<'_>, K, V, Type> {
397+
fn reborrow<'a>(&'a self) -> NodeRef<marker::Immut<'a>, K, V, Type> {
398398
NodeRef {
399399
height: self.height,
400400
node: self.node,

src/liballoc/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ impl String {
552552
/// assert_eq!("Hello �World", output);
553553
/// ```
554554
#[stable(feature = "rust1", since = "1.0.0")]
555-
pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str> {
555+
pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> Cow<'a, str> {
556556
let mut iter = lossy::Utf8Lossy::from_bytes(v).chunks();
557557

558558
let (first_valid, first_broken) = if let Some(chunk) = iter.next() {

src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ macro_rules! impls{
498498
/// # end: *const T,
499499
/// # phantom: PhantomData<&'a T>,
500500
/// # }
501-
/// fn borrow_vec<T>(vec: &Vec<T>) -> Slice<'_, T> {
501+
/// fn borrow_vec<'a, T>(vec: &'a Vec<T>) -> Slice<'a, T> {
502502
/// let ptr = vec.as_ptr();
503503
/// Slice {
504504
/// start: ptr,

src/libcore/ops/index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub trait Index<Idx: ?Sized> {
105105
/// impl Index<Side> for Balance {
106106
/// type Output = Weight;
107107
///
108-
/// fn index(&self, index: Side) -> &Self::Output {
108+
/// fn index<'a>(&'a self, index: Side) -> &'a Self::Output {
109109
/// println!("Accessing {:?}-side of balance immutably", index);
110110
/// match index {
111111
/// Side::Left => &self.left,
@@ -115,7 +115,7 @@ pub trait Index<Idx: ?Sized> {
115115
/// }
116116
///
117117
/// impl IndexMut<Side> for Balance {
118-
/// fn index_mut(&mut self, index: Side) -> &mut Self::Output {
118+
/// fn index_mut<'a>(&'a mut self, index: Side) -> &'a mut Self::Output {
119119
/// println!("Accessing {:?}-side of balance mutably", index);
120120
/// match index {
121121
/// Side::Left => &mut self.left,

src/librustdoc/clean/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ impl fmt::Debug for Item {
392392
impl Item {
393393
/// Finds the `doc` attribute as a NameValue and returns the corresponding
394394
/// value found.
395-
pub fn doc_value(&self) -> Option<&str> {
395+
pub fn doc_value<'a>(&'a self) -> Option<&'a str> {
396396
self.attrs.doc_value()
397397
}
398398
/// Finds all `doc` attributes as NameValues and returns their corresponding values, joined
@@ -699,11 +699,11 @@ impl<'a> Iterator for ListAttributesIter<'a> {
699699

700700
pub trait AttributesExt {
701701
/// Finds an attribute as List and returns the list of attributes nested inside.
702-
fn lists(&self, name: Symbol) -> ListAttributesIter<'_>;
702+
fn lists<'a>(&'a self, name: Symbol) -> ListAttributesIter<'a>;
703703
}
704704

705705
impl AttributesExt for [ast::Attribute] {
706-
fn lists(&self, name: Symbol) -> ListAttributesIter<'_> {
706+
fn lists<'a>(&'a self, name: Symbol) -> ListAttributesIter<'a> {
707707
ListAttributesIter {
708708
attrs: self.iter(),
709709
current_list: Vec::new().into_iter(),
@@ -952,7 +952,7 @@ impl Attributes {
952952

953953
/// Finds the `doc` attribute as a NameValue and returns the corresponding
954954
/// value found.
955-
pub fn doc_value(&self) -> Option<&str> {
955+
pub fn doc_value<'a>(&'a self) -> Option<&'a str> {
956956
self.doc_strings.first().map(|s| s.as_str())
957957
}
958958

@@ -1037,7 +1037,7 @@ impl Hash for Attributes {
10371037
}
10381038

10391039
impl AttributesExt for Attributes {
1040-
fn lists(&self, name: Symbol) -> ListAttributesIter<'_> {
1040+
fn lists<'a>(&'a self, name: Symbol) -> ListAttributesIter<'a> {
10411041
self.other_attrs.lists(name)
10421042
}
10431043
}

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@ fn full_path(cx: &Context, item: &clean::Item) -> String {
25412541
s
25422542
}
25432543

2544-
fn shorter(s: Option<&str>) -> String {
2544+
fn shorter<'a>(s: Option<&'a str>) -> String {
25452545
match s {
25462546
Some(s) => s.lines()
25472547
.skip_while(|s| s.chars().all(|c| c.is_whitespace()))

src/librustdoc/html/toc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl TocBuilder {
119119
/// Push a level `level` heading into the appropriate place in the
120120
/// hierarchy, returning a string containing the section number in
121121
/// `<num>.<num>.<num>` format.
122-
pub fn push(&mut self, level: u32, name: String, id: String) -> &str {
122+
pub fn push<'a>(&'a mut self, level: u32, name: String, id: String) -> &'a str {
123123
assert!(level >= 1);
124124

125125
// collapse all previous sections into their parents until we

src/librustdoc/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::html::markdown::{ErrorCodes, IdMap, Markdown, MarkdownWithToc, find_t
1717
use crate::test::{TestOptions, Collector};
1818

1919
/// Separate any lines at the start of the file that begin with `# ` or `%`.
20-
fn extract_leading_metadata(s: &str) -> (Vec<&str>, &str) {
20+
fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) {
2121
let mut metadata = Vec::new();
2222
let mut count = 0;
2323

src/libserialize/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ impl Json {
10311031

10321032
/// If the Json value is an Object, returns the value associated with the provided key.
10331033
/// Otherwise, returns None.
1034-
pub fn find(&self, key: &str) -> Option<&Json> {
1034+
pub fn find<'a>(&'a self, key: &str) -> Option<&'a Json>{
10351035
match *self {
10361036
Json::Object(ref map) => map.get(key),
10371037
_ => None
@@ -1052,7 +1052,7 @@ impl Json {
10521052
/// If the Json value is an Object, performs a depth-first search until
10531053
/// a value associated with the provided key is found. If no value is found
10541054
/// or the Json value is not an Object, returns `None`.
1055-
pub fn search(&self, key: &str) -> Option<&Json> {
1055+
pub fn search<'a>(&'a self, key: &str) -> Option<&'a Json> {
10561056
match self {
10571057
&Json::Object(ref map) => {
10581058
match map.get(key) {

0 commit comments

Comments
 (0)