From 554145609484d111f6ca3acaca644ae881c20a10 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 5 Oct 2020 22:47:52 +0800 Subject: [PATCH 1/2] Hint doc use convert::identity relative link --- library/core/src/hint.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 4eb47dd1378c5..5d8137f91ee06 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -98,8 +98,6 @@ pub fn spin_loop() { /// An identity function that *__hints__* to the compiler to be maximally pessimistic about what /// `black_box` could do. /// -/// [`std::convert::identity`]: https://doc.rust-lang.org/core/convert/fn.identity.html -/// /// Unlike [`std::convert::identity`], a Rust compiler is encouraged to assume that `black_box` can /// use `dummy` in any possible valid way that Rust code is allowed to without introducing undefined /// behavior in the calling code. This property makes `black_box` useful for writing code in which @@ -108,6 +106,8 @@ pub fn spin_loop() { /// Note however, that `black_box` is only (and can only be) provided on a "best-effort" basis. The /// extent to which it can block optimisations may vary depending upon the platform and code-gen /// backend used. Programs cannot rely on `black_box` for *correctness* in any way. +/// +/// [`std::convert::identity`]: ../convert/fn.identity.html #[cfg_attr(not(miri), inline)] #[cfg_attr(miri, inline(never))] #[unstable(feature = "test", issue = "50297")] From cb881d36ae0060e1dc6815e7caefe4e8df79dc09 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 5 Oct 2020 23:29:43 +0800 Subject: [PATCH 2/2] hint doc use intra-doc links Co-authored-by: Joshua Nelson --- library/core/src/hint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 5d8137f91ee06..454fb34e77e49 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -107,7 +107,7 @@ pub fn spin_loop() { /// extent to which it can block optimisations may vary depending upon the platform and code-gen /// backend used. Programs cannot rely on `black_box` for *correctness* in any way. /// -/// [`std::convert::identity`]: ../convert/fn.identity.html +/// [`std::convert::identity`]: crate::convert::identity #[cfg_attr(not(miri), inline)] #[cfg_attr(miri, inline(never))] #[unstable(feature = "test", issue = "50297")]