Skip to content

Commit a2a9e29

Browse files
committed
update docs references, fix linkchecker and tests
added some code in linkchecker to check the generic::String docs when trying to resolve links to alloc::string::String type alias. There's some lazy-loading that the browser does, but linkchecker doesn't, so maybe some general-purpose solution would be better, but this seemed better than a big list of exceptions.
1 parent 8ba3c69 commit a2a9e29

File tree

28 files changed

+65
-46
lines changed

28 files changed

+65
-46
lines changed

library/core/src/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ impl fmt::Debug for TypeId {
857857
/// ```rust
858858
/// assert_eq!(
859859
/// std::any::type_name::<Option<String>>(),
860-
/// "core::option::Option<alloc::string::String>",
860+
/// "core::option::Option<alloc::string::generic::String>",
861861
/// );
862862
/// ```
863863
#[must_use]

library/core/src/borrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
/// [`Box<T>`]: ../../std/boxed/struct.Box.html
4444
/// [`Mutex<T>`]: ../../std/sync/struct.Mutex.html
4545
/// [`Rc<T>`]: ../../std/rc/struct.Rc.html
46-
/// [`String`]: ../../std/string/struct.String.html
46+
/// [`String`]: ../../std/string/type.String.html
4747
/// [`borrow`]: Borrow::borrow
4848
///
4949
/// # Examples
@@ -151,7 +151,7 @@
151151
///
152152
/// [`Hash`]: crate::hash::Hash
153153
/// [`HashMap<K, V>`]: ../../std/collections/struct.HashMap.html
154-
/// [`String`]: ../../std/string/struct.String.html
154+
/// [`String`]: ../../std/string/type.String.html
155155
#[stable(feature = "rust1", since = "1.0.0")]
156156
#[rustc_diagnostic_item = "Borrow"]
157157
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]

library/core/src/char/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl char {
8686
/// decoding error.
8787
///
8888
/// It can occur, for example, when giving ill-formed UTF-8 bytes to
89-
/// [`String::from_utf8_lossy`](../std/string/struct.String.html#method.from_utf8_lossy).
89+
/// [`String::from_utf8_lossy`](../std/string/type.String.html#method.from_utf8_lossy).
9090
#[stable(feature = "assoc_char_consts", since = "1.52.0")]
9191
pub const REPLACEMENT_CHARACTER: char = '\u{FFFD}';
9292

library/core/src/convert/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub const fn identity<T>(x: T) -> T {
201201
/// [`Borrow`]: crate::borrow::Borrow
202202
/// [`Eq`]: crate::cmp::Eq
203203
/// [`Ord`]: crate::cmp::Ord
204-
/// [`String`]: ../../std/string/struct.String.html
204+
/// [`String`]: ../../std/string/type.String.html
205205
///
206206
/// ```
207207
/// fn is_hello<T: AsRef<str>>(s: T) {
@@ -442,7 +442,7 @@ pub const trait AsMut<T: PointeeSized>: PointeeSized {
442442
/// is_hello(s);
443443
/// ```
444444
///
445-
/// [`String`]: ../../std/string/struct.String.html
445+
/// [`String`]: ../../std/string/type.String.html
446446
/// [`Vec`]: ../../std/vec/struct.Vec.html
447447
#[rustc_diagnostic_item = "Into"]
448448
#[stable(feature = "rust1", since = "1.0.0")]
@@ -573,7 +573,7 @@ pub const trait Into<T>: Sized {
573573
/// }
574574
/// ```
575575
///
576-
/// [`String`]: ../../std/string/struct.String.html
576+
/// [`String`]: ../../std/string/type.String.html
577577
/// [`from`]: From::from
578578
/// [book]: ../../book/ch09-00-error-handling.html
579579
#[rustc_diagnostic_item = "From"]

library/core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@ pub trait Iterator {
20062006
/// ```
20072007
///
20082008
/// [`iter`]: Iterator::next
2009-
/// [`String`]: ../../std/string/struct.String.html
2009+
/// [`String`]: ../../std/string/type.String.html
20102010
/// [`char`]: type@char
20112011
#[inline]
20122012
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ marker_impls! {
450450
/// while variables captured by mutable reference never implement `Copy`.
451451
///
452452
/// [`Vec<T>`]: ../../std/vec/struct.Vec.html
453-
/// [`String`]: ../../std/string/struct.String.html
453+
/// [`String`]: ../../std/string/type.String.html
454454
/// [`size_of::<T>`]: size_of
455455
/// [impls]: #implementors
456456
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/ops/deref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ use crate::marker::PointeeSized;
102102
/// [method resolution]: ../../reference/expressions/method-call-expr.html
103103
/// [type coercions]: ../../reference/type-coercions.html
104104
/// [box]: ../../alloc/boxed/struct.Box.html
105-
/// [string]: ../../alloc/string/struct.String.html
105+
/// [string]: ../../alloc/string/type.String.html
106106
/// [vec]: ../../alloc/vec/struct.Vec.html
107107
/// [rc]: ../../alloc/rc/struct.Rc.html
108108
/// [cow]: ../../alloc/borrow/enum.Cow.html
@@ -229,7 +229,7 @@ impl<T: ?Sized> const Deref for &mut T {
229229
/// [method resolution]: ../../reference/expressions/method-call-expr.html
230230
/// [type coercions]: ../../reference/type-coercions.html
231231
/// [box]: ../../alloc/boxed/struct.Box.html
232-
/// [string]: ../../alloc/string/struct.String.html
232+
/// [string]: ../../alloc/string/type.String.html
233233
/// [rc]: ../../alloc/rc/struct.Rc.html
234234
/// [cow]: ../../alloc/borrow/enum.Cow.html
235235
///

library/core/src/option.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,8 @@ impl<T> Option<T> {
728728
/// reference to the value inside the original.
729729
///
730730
/// [`map`]: Option::map
731-
/// [String]: ../../std/string/struct.String.html "String"
732-
/// [`String`]: ../../std/string/struct.String.html "String"
731+
/// [String]: ../../std/string/type.String.html "String"
732+
/// [`String`]: ../../std/string/type.String.html "String"
733733
///
734734
/// ```
735735
/// let text: Option<String> = Some("Hello, world!".to_string());
@@ -1144,7 +1144,7 @@ impl<T> Option<T> {
11441144
/// Calculates the length of an <code>Option<[String]></code> as an
11451145
/// <code>Option<[usize]></code>, consuming the original:
11461146
///
1147-
/// [String]: ../../std/string/struct.String.html "String"
1147+
/// [String]: ../../std/string/type.String.html "String"
11481148
/// ```
11491149
/// let maybe_some_string = Some(String::from("Hello, World!"));
11501150
/// // `Option::map` takes self *by value*, consuming `maybe_some_string`
@@ -2312,7 +2312,7 @@ impl<'a, T> const From<&'a Option<T>> for Option<&'a T> {
23122312
/// to the value inside the original.
23132313
///
23142314
/// [`map`]: Option::map
2315-
/// [String]: ../../std/string/struct.String.html "String"
2315+
/// [String]: ../../std/string/type.String.html "String"
23162316
///
23172317
/// ```
23182318
/// let s: Option<String> = Some(String::from("Hello, Rustaceans!"));

library/core/src/pin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@
916916
//! [`Vec::set_len`]: ../../std/vec/struct.Vec.html#method.set_len
917917
//! [`VecDeque<T>`]: ../../std/collections/struct.VecDeque.html
918918
//! [VecDeque]: ../../std/collections/struct.VecDeque.html "collections::VecDeque"
919-
//! [`String`]: ../../std/string/struct.String.html "String"
919+
//! [`String`]: ../../std/string/type.String.html "String"
920920
921921
#![stable(feature = "pin", since = "1.33.0")]
922922

library/core/src/primitive_docs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ mod prim_bool {}
186186
/// because `!` coerces to `Result<!, ConnectionError>` automatically.
187187
///
188188
/// [`String::from_str`]: str::FromStr::from_str
189-
/// [`String`]: ../std/string/struct.String.html
189+
/// [`String`]: ../std/string/type.String.html
190190
/// [`FromStr`]: str::FromStr
191191
///
192192
/// # `!` and traits
@@ -407,7 +407,7 @@ impl ! {}
407407
/// assert_eq!(5, s.len() * size_of::<u8>());
408408
/// ```
409409
///
410-
/// [`String`]: ../std/string/struct.String.html
410+
/// [`String`]: ../std/string/type.String.html
411411
///
412412
/// As always, remember that a human intuition for 'character' might not map to
413413
/// Unicode's definitions. For example, despite looking similar, the 'é'

0 commit comments

Comments
 (0)