From 505d07da2859fa3fd2fde699be62e8adbbcb45cc Mon Sep 17 00:00:00 2001 From: Jynn Nelson Date: Tue, 24 Feb 2026 20:44:38 -0500 Subject: [PATCH] core and alloc doctests support doctest merging --- library/alloc/src/lib.rs | 2 +- library/core/src/alloc/global.rs | 2 +- library/core/src/hint.rs | 2 +- library/core/src/lib.rs | 2 +- library/core/src/range.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index 73e93657b02..7ac9cdc3833 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -63,7 +63,7 @@ #![doc( html_playground_url = "https://play.rust-lang.org/", issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/", - test(no_crate_inject, attr(allow(unused_variables), deny(warnings))) + test(no_crate_inject, attr(allow(unused_variables, duplicate_features), deny(warnings))) )] #![doc(auto_cfg(hide(no_global_oom_handling, no_rc, no_sync, target_has_atomic = "ptr")))] #![doc(rust_logo)] diff --git a/library/core/src/alloc/global.rs b/library/core/src/alloc/global.rs index bf3d3e0a5ac..e97398aa5dc 100644 --- a/library/core/src/alloc/global.rs +++ b/library/core/src/alloc/global.rs @@ -19,7 +19,7 @@ use crate::{cmp, ptr}; /// /// # Example /// -/// ``` +/// ```standalone_crate /// use std::alloc::{GlobalAlloc, Layout}; /// use std::cell::UnsafeCell; /// use std::ptr::null_mut; diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 03ed04dc5a6..a8e01e6e78b 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -514,7 +514,7 @@ pub const fn black_box(dummy: T) -> T { /// macro_rules! make_error { /// ($($args:expr),*) => { /// core::hint::must_use({ -/// let error = $crate::make_error(core::format_args!($($args),*)); +/// let error = make_error(core::format_args!($($args),*)); /// error /// }) /// }; diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 29869dd9198..e12c4306824 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -48,7 +48,7 @@ html_playground_url = "https://play.rust-lang.org/", issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/", test(no_crate_inject, attr(deny(warnings))), - test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))) + test(attr(allow(dead_code, deprecated, unused_variables, unused_mut, duplicate_features))) )] #![doc(rust_logo)] #![doc(auto_cfg(hide( diff --git a/library/core/src/range.rs b/library/core/src/range.rs index d12a4ef43e4..3c2c40d4920 100644 --- a/library/core/src/range.rs +++ b/library/core/src/range.rs @@ -584,7 +584,7 @@ impl const From> for RangeFrom { /// /// The `..=last` syntax is a `RangeToInclusive`: /// -/// ``` +/// ```standalone_crate /// #![feature(new_range)] /// assert_eq!((..=5), std::range::RangeToInclusive { last: 5 }); /// ```