Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get rid of duplicate primitive_docs #115494

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading