From 9abd80c0764e9ecbb6d2e52ab89d47bcda564588 Mon Sep 17 00:00:00 2001 From: CPerezz Date: Mon, 18 Jan 2021 23:47:01 +0100 Subject: [PATCH 1/2] Fix internal rustdoc broken links As it was suggested in #81037 `SpecFromIter` is not in the scope and therefore (even it should fail), we get a warning when we try do document private intems in `rust/library/alloc/`. This fixes #81037 by adding the trait in the scope and also adding an `allow(unused_imports)` flag so that the compiler does not complain, Since the trait is not used per se in the code, it's just needed to have properly documented docs. --- library/alloc/src/vec/spec_from_iter_nested.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/alloc/src/vec/spec_from_iter_nested.rs b/library/alloc/src/vec/spec_from_iter_nested.rs index 6abd4ff2a3f0a..3acee44337906 100644 --- a/library/alloc/src/vec/spec_from_iter_nested.rs +++ b/library/alloc/src/vec/spec_from_iter_nested.rs @@ -1,6 +1,8 @@ use core::iter::TrustedLen; use core::ptr::{self}; +#[allow(unused_imports)] +use super::SpecFromIter; use super::{SpecExtend, Vec}; /// Another specialization trait for Vec::from_iter From bc6720f872f759ba25329cc0a53d6bfa2c604341 Mon Sep 17 00:00:00 2001 From: CPerezz Date: Tue, 19 Jan 2021 18:28:33 +0100 Subject: [PATCH 2/2] Add SpecFromIter ref in the comments directly --- library/alloc/src/vec/spec_from_iter_nested.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/alloc/src/vec/spec_from_iter_nested.rs b/library/alloc/src/vec/spec_from_iter_nested.rs index 3acee44337906..ec390c62165a5 100644 --- a/library/alloc/src/vec/spec_from_iter_nested.rs +++ b/library/alloc/src/vec/spec_from_iter_nested.rs @@ -1,13 +1,11 @@ use core::iter::TrustedLen; use core::ptr::{self}; -#[allow(unused_imports)] -use super::SpecFromIter; use super::{SpecExtend, Vec}; /// Another specialization trait for Vec::from_iter /// necessary to manually prioritize overlapping specializations -/// see [`SpecFromIter`] for details. +/// see [`SpecFromIter`](super::SpecFromIter) for details. pub(super) trait SpecFromIterNested { fn from_iter(iter: I) -> Self; }