Skip to content

Commit 7b7caae

Browse files
committed
get rid of duplicate primitive_docs
1 parent df99bc1 commit 7b7caae

25 files changed

+12
-1645
lines changed

library/core/primitive_docs/box_into_raw.md

-1
This file was deleted.

library/core/primitive_docs/fs_file.md

-1
This file was deleted.

library/core/primitive_docs/io_bufread.md

-1
This file was deleted.

library/core/primitive_docs/io_read.md

-1
This file was deleted.

library/core/primitive_docs/io_seek.md

-1
This file was deleted.

library/core/primitive_docs/io_write.md

-1
This file was deleted.

library/core/primitive_docs/net_tosocketaddrs.md

-1
This file was deleted.

library/core/primitive_docs/process_exit.md

-1
This file was deleted.

library/core/primitive_docs/string_string.md

-1
This file was deleted.

library/core/src/primitive_docs.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// `library/{std,core}/src/primitive_docs.rs` should have the same contents.
2-
// These are different files so that relative links work properly without
3-
// having to have `CARGO_PKG_NAME` set, but conceptually they should always be the same.
41
#[rustc_doc_primitive = "bool"]
52
#[doc(alias = "true")]
63
#[doc(alias = "false")]
@@ -106,7 +103,7 @@ mod prim_bool {}
106103
/// behaviour of the `!` type - expressions with type `!` will coerce into any other type.
107104
///
108105
/// [`u32`]: prim@u32
109-
#[doc = concat!("[`exit`]: ", include_str!("../primitive_docs/process_exit.md"))]
106+
/// [`exit`]: ../std/process/fn.exit.html
110107
///
111108
/// # `!` and generics
112109
///
@@ -191,7 +188,7 @@ mod prim_bool {}
191188
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
192189
///
193190
/// [`String::from_str`]: str::FromStr::from_str
194-
#[doc = concat!("[`String`]: ", include_str!("../primitive_docs/string_string.md"))]
191+
/// [`String`]: ../std/string/struct.String.html
195192
/// [`FromStr`]: str::FromStr
196193
///
197194
/// # `!` and traits
@@ -267,7 +264,7 @@ mod prim_bool {}
267264
/// `impl` for this which simply panics, but the same is true for any type (we could `impl
268265
/// Default` for (eg.) [`File`] by just making [`default()`] panic.)
269266
///
270-
#[doc = concat!("[`File`]: ", include_str!("../primitive_docs/fs_file.md"))]
267+
/// [`File`]: ../std/fs/struct.File.html
271268
/// [`Debug`]: fmt::Debug
272269
/// [`default()`]: Default::default
273270
///
@@ -355,7 +352,7 @@ mod prim_never {}
355352
/// assert_eq!(5, s.len() * std::mem::size_of::<u8>());
356353
/// ```
357354
///
358-
#[doc = concat!("[`String`]: ", include_str!("../primitive_docs/string_string.md"))]
355+
/// [`String`]: ../std/string/struct.String.html
359356
///
360357
/// As always, remember that a human intuition for 'character' might not map to
361358
/// Unicode's definitions. For example, despite looking similar, the 'é'
@@ -572,7 +569,7 @@ impl Copy for () {
572569
/// [`null_mut`]: ptr::null_mut
573570
/// [`is_null`]: pointer::is_null
574571
/// [`offset`]: pointer::offset
575-
#[doc = concat!("[`into_raw`]: ", include_str!("../primitive_docs/box_into_raw.md"))]
572+
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
576573
/// [`write`]: ptr::write
577574
#[stable(feature = "rust1", since = "1.0.0")]
578575
mod prim_pointer {}
@@ -1361,7 +1358,7 @@ mod prim_usize {}
13611358
///
13621359
/// [`std::fmt`]: fmt
13631360
/// [`Hash`]: hash::Hash
1364-
#[doc = concat!("[`ToSocketAddrs`]: ", include_str!("../primitive_docs/net_tosocketaddrs.md"))]
1361+
/// [`ToSocketAddrs`]: ../std/net/trait.ToSocketAddrs.html
13651362
///
13661363
/// `&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T`
13671364
/// implements that trait:
@@ -1381,10 +1378,10 @@ mod prim_usize {}
13811378
///
13821379
/// [`FusedIterator`]: iter::FusedIterator
13831380
/// [`TrustedLen`]: iter::TrustedLen
1384-
#[doc = concat!("[`Seek`]: ", include_str!("../primitive_docs/io_seek.md"))]
1385-
#[doc = concat!("[`BufRead`]: ", include_str!("../primitive_docs/io_bufread.md"))]
1386-
#[doc = concat!("[`Read`]: ", include_str!("../primitive_docs/io_read.md"))]
1387-
#[doc = concat!("[`io::Write`]: ", include_str!("../primitive_docs/io_write.md"))]
1381+
/// [`Seek`]: ../std/io/trait.Seek.html
1382+
/// [`BufRead`]: ../std/io/trait.BufRead.html
1383+
/// [`Read`]: ../std/io/trait.Read.html
1384+
/// [`io::Write`]: ../std/io/trait.Write.html
13881385
///
13891386
/// Note that due to method call deref coercion, simply calling a trait method will act like they
13901387
/// work on references as well as they do on owned values! The implementations described here are

library/core/src/tuple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// See src/libstd/primitive_docs.rs for documentation.
1+
// See core/src/primitive_docs.rs for documentation.
22

33
use crate::cmp::Ordering::{self, *};
44
use crate::marker::ConstParamTy;

library/std/primitive_docs/box_into_raw.md

-1
This file was deleted.

library/std/primitive_docs/fs_file.md

-1
This file was deleted.

library/std/primitive_docs/io_bufread.md

-1
This file was deleted.

library/std/primitive_docs/io_read.md

-1
This file was deleted.

library/std/primitive_docs/io_seek.md

-1
This file was deleted.

library/std/primitive_docs/io_write.md

-1
This file was deleted.

library/std/primitive_docs/net_tosocketaddrs.md

-1
This file was deleted.

library/std/primitive_docs/process_exit.md

-1
This file was deleted.

library/std/primitive_docs/string_string.md

-1
This file was deleted.

library/std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ pub use core::primitive;
673673
// Include a number of private modules that exist solely to provide
674674
// the rustdoc documentation for primitive types. Using `include!`
675675
// because rustdoc only looks for these modules at the crate level.
676-
include!("primitive_docs.rs");
676+
include!("../../core/src/primitive_docs.rs");
677677

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

0 commit comments

Comments
 (0)