Skip to content

Commit

Permalink
get rid of duplicate primitive_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 18, 2023
1 parent df99bc1 commit 7b7caae
Show file tree
Hide file tree
Showing 25 changed files with 12 additions and 1,645 deletions.
1 change: 0 additions & 1 deletion library/core/primitive_docs/box_into_raw.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/fs_file.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/io_bufread.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/io_read.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/io_seek.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/io_write.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/net_tosocketaddrs.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/process_exit.md

This file was deleted.

1 change: 0 additions & 1 deletion library/core/primitive_docs/string_string.md

This file was deleted.

23 changes: 10 additions & 13 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// `library/{std,core}/src/primitive_docs.rs` should have the same contents.
// These are different files so that relative links work properly without
// having to have `CARGO_PKG_NAME` set, but conceptually they should always be the same.
#[rustc_doc_primitive = "bool"]
#[doc(alias = "true")]
#[doc(alias = "false")]
Expand Down Expand Up @@ -106,7 +103,7 @@ mod prim_bool {}
/// behaviour of the `!` type - expressions with type `!` will coerce into any other type.
///
/// [`u32`]: prim@u32
#[doc = concat!("[`exit`]: ", include_str!("../primitive_docs/process_exit.md"))]
/// [`exit`]: ../std/process/fn.exit.html
///
/// # `!` and generics
///
Expand Down Expand Up @@ -191,7 +188,7 @@ mod prim_bool {}
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
///
/// [`String::from_str`]: str::FromStr::from_str
#[doc = concat!("[`String`]: ", include_str!("../primitive_docs/string_string.md"))]
/// [`String`]: ../std/string/struct.String.html
/// [`FromStr`]: str::FromStr
///
/// # `!` and traits
Expand Down Expand Up @@ -267,7 +264,7 @@ mod prim_bool {}
/// `impl` for this which simply panics, but the same is true for any type (we could `impl
/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
///
#[doc = concat!("[`File`]: ", include_str!("../primitive_docs/fs_file.md"))]
/// [`File`]: ../std/fs/struct.File.html
/// [`Debug`]: fmt::Debug
/// [`default()`]: Default::default
///
Expand Down Expand Up @@ -355,7 +352,7 @@ mod prim_never {}
/// assert_eq!(5, s.len() * std::mem::size_of::<u8>());
/// ```
///
#[doc = concat!("[`String`]: ", include_str!("../primitive_docs/string_string.md"))]
/// [`String`]: ../std/string/struct.String.html
///
/// As always, remember that a human intuition for 'character' might not map to
/// Unicode's definitions. For example, despite looking similar, the 'é'
Expand Down Expand Up @@ -572,7 +569,7 @@ impl Copy for () {
/// [`null_mut`]: ptr::null_mut
/// [`is_null`]: pointer::is_null
/// [`offset`]: pointer::offset
#[doc = concat!("[`into_raw`]: ", include_str!("../primitive_docs/box_into_raw.md"))]
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
/// [`write`]: ptr::write
#[stable(feature = "rust1", since = "1.0.0")]
mod prim_pointer {}
Expand Down Expand Up @@ -1361,7 +1358,7 @@ mod prim_usize {}
///
/// [`std::fmt`]: fmt
/// [`Hash`]: hash::Hash
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
/// [`ToSocketAddrs`]: ../std/net/trait.ToSocketAddrs.html
///
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
/// implements that trait:
Expand All @@ -1381,10 +1378,10 @@ mod prim_usize {}
///
/// [`FusedIterator`]: iter::FusedIterator
/// [`TrustedLen`]: iter::TrustedLen
#[doc = concat!("[`Seek`]: ", include_str!("../primitive_docs/io_seek.md"))]
#[doc = concat!("[`BufRead`]: ", include_str!("../primitive_docs/io_bufread.md"))]
#[doc = concat!("[`Read`]: ", include_str!("../primitive_docs/io_read.md"))]
#[doc = concat!("[`io::Write`]: ", include_str!("../primitive_docs/io_write.md"))]
/// [`Seek`]: ../std/io/trait.Seek.html
/// [`BufRead`]: ../std/io/trait.BufRead.html
/// [`Read`]: ../std/io/trait.Read.html
/// [`io::Write`]: ../std/io/trait.Write.html
///
/// Note that due to method call deref coercion, simply calling a trait method will act like they
/// work on references as well as they do on owned values! The implementations described here are
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/tuple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// See src/libstd/primitive_docs.rs for documentation.
// See core/src/primitive_docs.rs for documentation.

use crate::cmp::Ordering::{self, *};
use crate::marker::ConstParamTy;
Expand Down
1 change: 0 additions & 1 deletion library/std/primitive_docs/box_into_raw.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/fs_file.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/io_bufread.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/io_read.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/io_seek.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/io_write.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/net_tosocketaddrs.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/process_exit.md

This file was deleted.

1 change: 0 additions & 1 deletion library/std/primitive_docs/string_string.md

This file was deleted.

2 changes: 1 addition & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ pub use core::primitive;
// Include a number of private modules that exist solely to provide
// the rustdoc documentation for primitive types. Using `include!`
// because rustdoc only looks for these modules at the crate level.
include!("primitive_docs.rs");
include!("../../core/src/primitive_docs.rs");

// Include a number of private modules that exist solely to provide
// the rustdoc documentation for the existing keywords. Using `include!`
Expand Down
Loading

0 comments on commit 7b7caae

Please sign in to comment.