about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-12-19 09:23:34 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-12-22 11:45:23 -0500
commit8842c1ccf33649f00e72a6f0be284919a847e69b (patch)
tree36b3270c57b5cf28995c7fddece60f8f77aa0910
parent4092891a8f2ca5947d5312e1949ecf701a4f25de (diff)
downloadrust-8842c1ccf33649f00e72a6f0be284919a847e69b.tar.gz
rust-8842c1ccf33649f00e72a6f0be284919a847e69b.zip
Fix new ambiguity in the standard library
This caught several bugs where people expected `slice` to link to the
primitive, but it linked to the module instead.

This also uses `cfg_attr(bootstrap)` since the ambiguity only occurs
when compiling with stage 1.
-rw-r--r--library/std/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 39b0ca63301..b7f9bea7c2a 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -175,7 +175,7 @@
 //! [`str`]: prim@str
 //! [`mpsc`]: sync::mpsc
 //! [`std::cmp`]: cmp
-//! [`std::slice`]: slice
+//! [`std::slice`]: mod@slice
 //! [`use std::env`]: env/index.html
 //! [`use`]: ../book/ch07-02-defining-modules-to-control-scope-and-privacy.html
 //! [crates.io]: https://crates.io
@@ -185,7 +185,8 @@
 //! [other]: #what-is-in-the-standard-library-documentation
 //! [primitive types]: ../book/ch03-02-data-types.html
 //! [rust-discord]: https://discord.gg/rust-lang
-
+#![cfg_attr(not(bootstrap), doc = "[array]: prim@array")]
+#![cfg_attr(not(bootstrap), doc = "[slice]: prim@slice")]
 #![cfg_attr(not(feature = "restricted-std"), stable(feature = "rust1", since = "1.0.0"))]
 #![cfg_attr(feature = "restricted-std", unstable(feature = "restricted_std", issue = "none"))]
 #![doc(