diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-21 01:39:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-21 01:39:18 +0200 |
| commit | 8bdae3af171c957bfa46ae1ce6b03f1fb0ef501a (patch) | |
| tree | a7ccf8f12e2f216b8c21c14d6e4363518667ffc6 | |
| parent | 041c65410532a5d0dddec475c85cfa57648e712f (diff) | |
| parent | 040d88dda1c65d6cb3cd5df5e81075a281f90da4 (diff) | |
| download | rust-8bdae3af171c957bfa46ae1ce6b03f1fb0ef501a.tar.gz rust-8bdae3af171c957bfa46ae1ce6b03f1fb0ef501a.zip | |
Rollup merge of #65633 - Rantanen:doc-example-paths, r=Centril
Remove leading :: from paths in doc examples
Noted some pre-2018 path syntax in the doc examples, for example:
https://doc.rust-lang.org/std/process/fn.exit.html
```rust
fn main() {
::std::process::exit(match run_app() {
Ok(_) => 0,
...
```
Couldn't find an existing issue on this (then again, "::" makes for an annoying thing to search for) so if there is already something fixing this and/or there's a reason to not fix it, just close this PR.
(Also fixed indentation in the `process::exit()` docs)
| -rw-r--r-- | src/libcore/iter/traits/collect.rs | 2 | ||||
| -rw-r--r-- | src/libcore/ops/unsize.rs | 2 | ||||
| -rw-r--r-- | src/libcore/str/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net/udp.rs | 2 | ||||
| -rw-r--r-- | src/libstd/process.rs | 12 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/libcore/iter/traits/collect.rs b/src/libcore/iter/traits/collect.rs index 25439136b85..00a86417058 100644 --- a/src/libcore/iter/traits/collect.rs +++ b/src/libcore/iter/traits/collect.rs @@ -167,7 +167,7 @@ pub trait FromIterator<A>: Sized { /// // and we'll implement IntoIterator /// impl IntoIterator for MyCollection { /// type Item = i32; -/// type IntoIter = ::std::vec::IntoIter<Self::Item>; +/// type IntoIter = std::vec::IntoIter<Self::Item>; /// /// fn into_iter(self) -> Self::IntoIter { /// self.0.into_iter() diff --git a/src/libcore/ops/unsize.rs b/src/libcore/ops/unsize.rs index 8e468300846..d29147645f7 100644 --- a/src/libcore/ops/unsize.rs +++ b/src/libcore/ops/unsize.rs @@ -76,7 +76,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {} /// ``` /// # #![feature(dispatch_from_dyn, unsize)] /// # use std::{ops::DispatchFromDyn, marker::Unsize}; -/// # struct Rc<T: ?Sized>(::std::rc::Rc<T>); +/// # struct Rc<T: ?Sized>(std::rc::Rc<T>); /// impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Rc<U>> for Rc<T> /// where /// T: Unsize<U>, diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 885696e5acf..f67012d8f2f 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -176,7 +176,7 @@ Section: Creating a string /// ``` /// fn from_utf8_lossy<F>(mut input: &[u8], mut push: F) where F: FnMut(&str) { /// loop { -/// match ::std::str::from_utf8(input) { +/// match std::str::from_utf8(input) { /// Ok(valid) => { /// push(valid); /// break @@ -184,7 +184,7 @@ Section: Creating a string /// Err(error) => { /// let (valid, after_valid) = input.split_at(error.valid_up_to()); /// unsafe { -/// push(::std::str::from_utf8_unchecked(valid)) +/// push(std::str::from_utf8_unchecked(valid)) /// } /// push("\u{FFFD}"); /// diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs index 46bbd8855de..a9e4457f423 100644 --- a/src/libstd/net/udp.rs +++ b/src/libstd/net/udp.rs @@ -202,7 +202,7 @@ impl UdpSocket { /// /// let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address"); /// assert_eq!(socket.peer_addr().unwrap_err().kind(), - /// ::std::io::ErrorKind::NotConnected); + /// std::io::ErrorKind::NotConnected); /// ``` #[stable(feature = "udp_peer_addr", since = "1.40.0")] pub fn peer_addr(&self) -> io::Result<SocketAddr> { diff --git a/src/libstd/process.rs b/src/libstd/process.rs index da136ca6bf6..4b0cf8312f1 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -1488,12 +1488,12 @@ impl Child { /// } /// /// fn main() { -/// ::std::process::exit(match run_app() { -/// Ok(_) => 0, -/// Err(err) => { -/// eprintln!("error: {:?}", err); -/// 1 -/// } +/// std::process::exit(match run_app() { +/// Ok(_) => 0, +/// Err(err) => { +/// eprintln!("error: {:?}", err); +/// 1 +/// } /// }); /// } /// ``` |
