Skip to content

Commit

Permalink
Rollup merge of #65633 - Rantanen:doc-example-paths, r=Centril
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Centril authored Oct 20, 2019
2 parents 041c654 + 040d88d commit 8bdae3a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/libcore/iter/traits/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/unsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ 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
/// }
/// 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}");
///
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
12 changes: 6 additions & 6 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// }
/// });
/// }
/// ```
Expand Down

0 comments on commit 8bdae3a

Please sign in to comment.