Skip to content

Commit 4c221b3

Browse files
committed
Revert changes to the standard library
Moved to its own PR
1 parent 37f6aa7 commit 4c221b3

File tree

16 files changed

+25
-25
lines changed

16 files changed

+25
-25
lines changed

src/liballoc/collections/btree/map.rs

+4-4
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

+5-5
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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) {

src/libstd/sync/mpsc/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn wait_timeout_receiver<'a, 'b, T>(lock: &'a Mutex<State<T>>,
140140
new_guard
141141
}
142142

143-
fn abort_selection<T>(guard: &mut MutexGuard<'_, State<T>>) -> bool {
143+
fn abort_selection<'a, T>(guard: &mut MutexGuard<'a , State<T>>) -> bool {
144144
match mem::replace(&mut guard.blocker, NoneBlocked) {
145145
NoneBlocked => true,
146146
BlockedSender(token) => {

src/libstd/sys/redox/ext/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl UnixListener {
673673
/// }
674674
/// ```
675675
#[stable(feature = "unix_socket_redox", since = "1.29.0")]
676-
pub fn incoming(&self) -> Incoming {
676+
pub fn incoming<'a>(&'a self) -> Incoming<'a> {
677677
Incoming { listener: self }
678678
}
679679
}

src/libstd/sys/unix/ext/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ impl UnixListener {
894894
/// }
895895
/// ```
896896
#[stable(feature = "unix_socket", since = "1.10.0")]
897-
pub fn incoming(&self) -> Incoming<'_> {
897+
pub fn incoming<'a>(&'a self) -> Incoming<'a> {
898898
Incoming { listener: self }
899899
}
900900
}

src/libstd/sys/windows/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fn wide_char_to_multi_byte(code_page: u32,
195195
}
196196
}
197197

198-
pub fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] {
198+
pub fn truncate_utf16_at_nul<'a>(v: &'a [u16]) -> &'a [u16] {
199199
match v.iter().position(|c| *c == 0) {
200200
// don't include the 0
201201
Some(i) => &v[..i],

src/libstd/sys/windows/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn is_verbatim_sep(b: u8) -> bool {
1919
b == b'\\'
2020
}
2121

22-
pub fn parse_prefix(path: &OsStr) -> Option<Prefix<'_>> {
22+
pub fn parse_prefix<'a>(path: &'a OsStr) -> Option<Prefix<'a>> {
2323
use crate::path::Prefix::*;
2424
unsafe {
2525
// The unsafety here stems from converting between &OsStr and &[u8]

src/libstd/sys_common/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub mod test {
1616
p.join(path)
1717
}
1818

19-
pub fn path(&self) -> &Path {
19+
pub fn path<'a>(&'a self) -> &'a Path {
2020
let TempDir(ref p) = *self;
2121
p
2222
}

0 commit comments

Comments
 (0)