From b661e98f09a195cd13457525b09b6db628835734 Mon Sep 17 00:00:00 2001 From: Caio Date: Sun, 1 Dec 2024 19:10:44 -0300 Subject: [PATCH 01/10] Fix #128346 --- compiler/rustc_expand/src/mbe/transcribe.rs | 6 +++-- tests/crashes/128346.rs | 13 ----------- .../macro-metavar-expr-concat/repetitions.rs | 22 +++++++++++++++++-- .../repetitions.stderr | 22 +++++++++++++++++++ 4 files changed, 46 insertions(+), 17 deletions(-) delete mode 100644 tests/crashes/128346.rs create mode 100644 tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index b77d02e630a21..c780cfd0e8fd4 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -696,8 +696,10 @@ fn transcribe_metavar_expr<'a>( MetaVarExprConcatElem::Var(ident) => { match matched_from_ident(dcx, *ident, interp)? { NamedMatch::MatchedSeq(named_matches) => { - let curr_idx = repeats.last().unwrap().0; - match &named_matches[curr_idx] { + let Some((curr_idx, _)) = repeats.last() else { + return Err(dcx.struct_span_err(sp.entire(), "invalid syntax")); + }; + match &named_matches[*curr_idx] { // FIXME(c410-f3r) Nested repetitions are unimplemented MatchedSeq(_) => unimplemented!(), MatchedSingle(pnr) => { diff --git a/tests/crashes/128346.rs b/tests/crashes/128346.rs deleted file mode 100644 index 93d9c40a544e9..0000000000000 --- a/tests/crashes/128346.rs +++ /dev/null @@ -1,13 +0,0 @@ -//@ known-bug: rust-lang/rust#128346 - -macro_rules! one_rep { - ( $($a:ident)* ) => { - A( - const ${concat($a, Z)}: i32 = 3; - )* - }; -} - -fn main() { - one_rep!(A B C); -} diff --git a/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs b/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs index 781443207ac19..52a7d5cd8a7e6 100644 --- a/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs +++ b/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs @@ -1,5 +1,3 @@ -//@ run-pass - #![feature(macro_metavar_expr_concat)] macro_rules! one_rep { @@ -10,9 +8,29 @@ macro_rules! one_rep { }; } +macro_rules! issue_128346 { + ( $($a:ident)* ) => { + A( + const ${concat($a, Z)}: i32 = 3; + //~^ ERROR invalid syntax + )* + }; +} + +macro_rules! issue_131393 { + ($t:ident $($en:ident)?) => { + read::<${concat($t, $en)}>() + //~^ ERROR invalid syntax + //~| ERROR invalid syntax + } +} + fn main() { one_rep!(A B C); assert_eq!(AZ, 3); assert_eq!(BZ, 3); assert_eq!(CZ, 3); + issue_128346!(A B C); + issue_131393!(u8); + issue_131393!(u16 le); } diff --git a/tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr b/tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr new file mode 100644 index 0000000000000..c3006c4be5df2 --- /dev/null +++ b/tests/ui/macros/macro-metavar-expr-concat/repetitions.stderr @@ -0,0 +1,22 @@ +error: invalid syntax + --> $DIR/repetitions.rs:14:20 + | +LL | const ${concat($a, Z)}: i32 = 3; + | ^^^^^^^^^^^^^^^ + +error: invalid syntax + --> $DIR/repetitions.rs:22:17 + | +LL | read::<${concat($t, $en)}>() + | ^^^^^^^^^^^^^^^^^ + +error: invalid syntax + --> $DIR/repetitions.rs:22:17 + | +LL | read::<${concat($t, $en)}>() + | ^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 3 previous errors + From 00c5289c649394d544b6189e2bcdbcc7ceff49f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Bj=C3=B8rnager=20Jensen?= Date: Mon, 16 Dec 2024 10:42:26 +0100 Subject: [PATCH 02/10] Add 'into_array' conversion destructors for 'Box', 'Rc', and 'Arc'; --- library/alloc/src/boxed.rs | 20 ++++++++++++++++++++ library/alloc/src/rc.rs | 20 ++++++++++++++++++++ library/alloc/src/sync.rs | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 23b85fbd4ebc3..ca3bd24a42031 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -761,6 +761,26 @@ impl Box<[T]> { }; unsafe { Ok(RawVec::from_raw_parts_in(ptr.as_ptr(), len, Global).into_box(len)) } } + + /// Converts the boxed slice into a boxed array. + /// + /// This operation does not reallocate; the underlying array of the slice is simply reinterpreted as an array type. + /// + /// If `N` is not exactly equal to the length of `self`, then this method returns `None`. + #[unstable(feature = "slice_as_array", issue = "133508")] + #[inline] + #[must_use] + pub fn into_array(self) -> Option> { + if self.len() == N { + let ptr = Self::into_raw(self) as *mut [T; N]; + + // SAFETY: The underlying array of a slice has the exact same layout as an actual array `[T; N]` if `N` is equal to the slice's length. + let me = unsafe { Box::from_raw(ptr) }; + Some(me) + } else { + None + } + } } impl Box<[T], A> { diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index bb27fe3c62dcd..58edb44e37389 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1084,6 +1084,26 @@ impl Rc<[T]> { )) } } + + /// Converts the reference-counted slice into a reference-counted array. + /// + /// This operation does not reallocate; the underlying array of the slice is simply reinterpreted as an array type. + /// + /// If `N` is not exactly equal to the length of `self`, then this method returns `None`. + #[unstable(feature = "slice_as_array", issue = "133508")] + #[inline] + #[must_use] + pub fn into_array(self) -> Option> { + if self.len() == N { + let ptr = Self::into_raw(self) as *const [T; N]; + + // SAFETY: The underlying array of a slice has the exact same layout as an actual array `[T; N]` if `N` is equal to the slice's length. + let me = unsafe { Rc::from_raw(ptr) }; + Some(me) + } else { + None + } + } } impl Rc<[T], A> { diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 6cf41a3fa4e16..e499d1b04f409 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1203,6 +1203,26 @@ impl Arc<[T]> { )) } } + + /// Converts the reference-counted slice into a reference-counted array. + /// + /// This operation does not reallocate; the underlying array of the slice is simply reinterpreted as an array type. + /// + /// If `N` is not exactly equal to the length of `self`, then this method returns `None`. + #[unstable(feature = "slice_as_array", issue = "133508")] + #[inline] + #[must_use] + pub fn into_array(self) -> Option> { + if self.len() == N { + let ptr = Self::into_raw(self) as *const [T; N]; + + // SAFETY: The underlying array of a slice has the exact same layout as an actual array `[T; N]` if `N` is equal to the slice's length. + let me = unsafe { Arc::from_raw(ptr) }; + Some(me) + } else { + None + } + } } impl Arc<[T], A> { From b5e8a5d3939935eecfe8ed2dbc97ad748e090d90 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Wed, 13 Oct 2021 08:46:34 -0700 Subject: [PATCH 03/10] Document collection `From` and `FromIterator` impls that drop duplicate keys. This behavior is worth documenting because there are other plausible alternatives, such as panicking when a duplicate is encountered, and it reminds the programmer to consider whether they should, for example, coalesce duplicate keys first. --- library/alloc/src/collections/btree/map.rs | 9 ++++++++- library/alloc/src/collections/btree/set.rs | 4 ++++ library/std/src/collections/hash/map.rs | 9 +++++++++ library/std/src/collections/hash/set.rs | 4 ++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index d1ce4e215ed9c..56679eaa11894 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -2289,6 +2289,10 @@ impl FusedIterator for RangeMut<'_, K, V> {} #[stable(feature = "rust1", since = "1.0.0")] impl FromIterator<(K, V)> for BTreeMap { + /// Constructs a `BTreeMap` from an iterator of key-value pairs. + /// + /// If the iterator produces any pairs with equal keys, + /// all but the last value for each such key are discarded. fn from_iter>(iter: T) -> BTreeMap { let mut inputs: Vec<_> = iter.into_iter().collect(); @@ -2403,7 +2407,10 @@ where #[stable(feature = "std_collections_from_array", since = "1.56.0")] impl From<[(K, V); N]> for BTreeMap { - /// Converts a `[(K, V); N]` into a `BTreeMap<(K, V)>`. + /// Converts a `[(K, V); N]` into a `BTreeMap`. + /// + /// If any entries in the array have equal keys, all but the last entry for each such key + /// are discarded. /// /// ``` /// use std::collections::BTreeMap; diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 6f8c3b2d152b8..9f5a42b5f6d2d 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -1491,6 +1491,10 @@ impl BTreeSet { impl From<[T; N]> for BTreeSet { /// Converts a `[T; N]` into a `BTreeSet`. /// + /// If the array contains any equal values, all but the last instance of each are discarded. + /// + /// # Examples + /// /// ``` /// use std::collections::BTreeSet; /// diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 109bc3946346f..5b2cd53763b90 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -1446,6 +1446,11 @@ impl From<[(K, V); N]> for HashMap where K: Eq + Hash, { + /// Converts a `[(K, V); N]` into a `HashMap`. + /// + /// If any entries in the array have equal keys, all but the last entry for each such key + /// are discarded. + /// /// # Examples /// /// ``` @@ -3219,6 +3224,10 @@ where K: Eq + Hash, S: BuildHasher + Default, { + /// Constructs a `HashMap` from an iterator of key-value pairs. + /// + /// If the iterator produces any pairs with equal keys, + /// all but the last value for each such key are discarded. fn from_iter>(iter: T) -> HashMap { let mut map = HashMap::with_hasher(Default::default()); map.extend(iter); diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 4c81aaff45886..8e840aaa07f92 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -1091,6 +1091,10 @@ impl From<[T; N]> for HashSet where T: Eq + Hash, { + /// Converts a `[T; N]` into a `HashSet`. + /// + /// If the array contains any equal values, all but the last instance of each are discarded. + /// /// # Examples /// /// ``` From f19ba15a2cdc396a353fff70431df23016dc5276 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Sat, 21 Dec 2024 22:45:04 -0800 Subject: [PATCH 04/10] Fix forgetting to save statx availability on success Signed-off-by: Alex Saveau --- library/std/src/sys/pal/unix/fs.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index 37029bcd36e30..408f8020c5657 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -168,7 +168,8 @@ cfg_has_statx! {{ ) -> c_int } - if STATX_SAVED_STATE.load(Ordering::Relaxed) == STATX_STATE::Unavailable as u8 { + let statx_availability = STATX_SAVED_STATE.load(Ordering::Relaxed); + if statx_availability == STATX_STATE::Unavailable as u8 { return None; } @@ -200,6 +201,9 @@ cfg_has_statx! {{ return None; } } + if statx_availability == STATX_STATE::Unknown as u8 { + STATX_SAVED_STATE.store(STATX_STATE::Present as u8, Ordering::Relaxed); + } // We cannot fill `stat64` exhaustively because of private padding fields. let mut stat: stat64 = mem::zeroed(); From 6a43716ada10c18d6991dd9408ce2f31214cb8f3 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Sun, 22 Dec 2024 08:13:00 -0800 Subject: [PATCH 05/10] Specify only that duplicates are discarded, not the order. --- library/alloc/src/collections/btree/map.rs | 6 +++--- library/alloc/src/collections/btree/set.rs | 3 ++- library/std/src/collections/hash/map.rs | 6 +++--- library/std/src/collections/hash/set.rs | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 56679eaa11894..6d305386dbfa0 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -2292,7 +2292,7 @@ impl FromIterator<(K, V)> for BTreeMap { /// Constructs a `BTreeMap` from an iterator of key-value pairs. /// /// If the iterator produces any pairs with equal keys, - /// all but the last value for each such key are discarded. + /// all but one of the corresponding values will be dropped. fn from_iter>(iter: T) -> BTreeMap { let mut inputs: Vec<_> = iter.into_iter().collect(); @@ -2409,8 +2409,8 @@ where impl From<[(K, V); N]> for BTreeMap { /// Converts a `[(K, V); N]` into a `BTreeMap`. /// - /// If any entries in the array have equal keys, all but the last entry for each such key - /// are discarded. + /// If any entries in the array have equal keys, + /// all but one of the corresponding values will be dropped. /// /// ``` /// use std::collections::BTreeMap; diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 9f5a42b5f6d2d..9660023d6945e 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -1491,7 +1491,8 @@ impl BTreeSet { impl From<[T; N]> for BTreeSet { /// Converts a `[T; N]` into a `BTreeSet`. /// - /// If the array contains any equal values, all but the last instance of each are discarded. + /// If the array contains any equal values, + /// all but one will be dropped. /// /// # Examples /// diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 5b2cd53763b90..56d734ba2fbfb 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -1448,8 +1448,8 @@ where { /// Converts a `[(K, V); N]` into a `HashMap`. /// - /// If any entries in the array have equal keys, all but the last entry for each such key - /// are discarded. + /// If any entries in the array have equal keys, + /// all but one of the corresponding values will be dropped. /// /// # Examples /// @@ -3227,7 +3227,7 @@ where /// Constructs a `HashMap` from an iterator of key-value pairs. /// /// If the iterator produces any pairs with equal keys, - /// all but the last value for each such key are discarded. + /// all but one of the corresponding values will be dropped. fn from_iter>(iter: T) -> HashMap { let mut map = HashMap::with_hasher(Default::default()); map.extend(iter); diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 8e840aaa07f92..bcf6d6b4ccf3a 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -1093,7 +1093,8 @@ where { /// Converts a `[T; N]` into a `HashSet`. /// - /// If the array contains any equal values, all but the last instance of each are discarded. + /// If the array contains any equal values, + /// all but one will be dropped. /// /// # Examples /// From 6a89f8789ab918e4112f4f100c6750f3686d46a1 Mon Sep 17 00:00:00 2001 From: deltragon Date: Tue, 24 Dec 2024 14:37:17 +0100 Subject: [PATCH 06/10] Use scoped threads in `std::sync::Barrier` examples This removes boilerplate around `Arc`s and makes the code more clear. --- library/std/src/sync/barrier.rs | 60 ++++++++++++++------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/library/std/src/sync/barrier.rs b/library/std/src/sync/barrier.rs index 82cc13a74b7f1..14e4a9abe6f17 100644 --- a/library/std/src/sync/barrier.rs +++ b/library/std/src/sync/barrier.rs @@ -10,26 +10,22 @@ use crate::sync::{Condvar, Mutex}; /// # Examples /// /// ``` -/// use std::sync::{Arc, Barrier}; +/// use std::sync::Barrier; /// use std::thread; /// /// let n = 10; -/// let mut handles = Vec::with_capacity(n); -/// let barrier = Arc::new(Barrier::new(n)); -/// for _ in 0..n { -/// let c = Arc::clone(&barrier); -/// // The same messages will be printed together. -/// // You will NOT see any interleaving. -/// handles.push(thread::spawn(move || { -/// println!("before wait"); -/// c.wait(); -/// println!("after wait"); -/// })); -/// } -/// // Wait for other threads to finish. -/// for handle in handles { -/// handle.join().unwrap(); -/// } +/// let barrier = Barrier::new(n); +/// thread::scope(|s| { +/// for _ in 0..n { +/// // The same messages will be printed together. +/// // You will NOT see any interleaving. +/// s.spawn(|| { +/// println!("before wait"); +/// barrier.wait(); +/// println!("after wait"); +/// }); +/// } +/// }); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub struct Barrier { @@ -105,26 +101,22 @@ impl Barrier { /// # Examples /// /// ``` - /// use std::sync::{Arc, Barrier}; + /// use std::sync::Barrier; /// use std::thread; /// /// let n = 10; - /// let mut handles = Vec::with_capacity(n); - /// let barrier = Arc::new(Barrier::new(n)); - /// for _ in 0..n { - /// let c = Arc::clone(&barrier); - /// // The same messages will be printed together. - /// // You will NOT see any interleaving. - /// handles.push(thread::spawn(move || { - /// println!("before wait"); - /// c.wait(); - /// println!("after wait"); - /// })); - /// } - /// // Wait for other threads to finish. - /// for handle in handles { - /// handle.join().unwrap(); - /// } + /// let barrier = Barrier::new(n); + /// thread::scope(|s| { + /// for _ in 0..n { + /// // The same messages will be printed together. + /// // You will NOT see any interleaving. + /// s.spawn(|| { + /// println!("before wait"); + /// barrier.wait(); + /// println!("after wait"); + /// }); + /// } + /// }); /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn wait(&self) -> BarrierWaitResult { From d0c1975e4b458e30eeab37b9cd4e455f8c69cf4d Mon Sep 17 00:00:00 2001 From: wtlin1228 Date: Thu, 26 Dec 2024 13:56:45 +0800 Subject: [PATCH 07/10] docs: update code example for Iterator#rposition --- library/core/src/iter/traits/iterator.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index ff39e8ac25f8f..91c3a4b29b539 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -3051,6 +3051,7 @@ pub trait Iterator { /// /// // we can still use `iter`, as there are more elements. /// assert_eq!(iter.next(), Some(&-1)); + /// assert_eq!(iter.next_back(), Some(&3)); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] From f806357999179a6be4bd8ecbfd3ab330eaf60a20 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 26 Dec 2024 16:09:30 +0100 Subject: [PATCH 08/10] unwinding: bump version to fix asm With #80608 the `unwinding` crate no longer builds. The upstream crate has been updated to build by manually adding directives to the naked_asm stream. Bump the dependency in Rust to get this newer version. This fixes the build for Xous, and closes #134403. Signed-off-by: Sean Cross --- library/Cargo.lock | 4 ++-- library/unwind/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Cargo.lock b/library/Cargo.lock index 22f6e1edf21ff..15ca4cbff7b79 100644 --- a/library/Cargo.lock +++ b/library/Cargo.lock @@ -403,9 +403,9 @@ dependencies = [ [[package]] name = "unwinding" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c6cb20f236dae10c69b0b45d82ef50af8b7e45c10e429e7901d26b49b4dbf3" +checksum = "51f06a05848f650946acef3bf525fe96612226b61f74ae23ffa4e98bfbb8ab3c" dependencies = [ "compiler_builtins", "gimli 0.31.1", diff --git a/library/unwind/Cargo.toml b/library/unwind/Cargo.toml index 96ddae16f0ab3..e13c9a06c05d1 100644 --- a/library/unwind/Cargo.toml +++ b/library/unwind/Cargo.toml @@ -22,7 +22,7 @@ cfg-if = "1.0" libc = { version = "0.2.140", features = ['rustc-dep-of-std'], default-features = false } [target.'cfg(target_os = "xous")'.dependencies] -unwinding = { version = "0.2.3", features = ['rustc-dep-of-std', 'unwinder', 'fde-custom'], default-features = false } +unwinding = { version = "0.2.5", features = ['rustc-dep-of-std', 'unwinder', 'fde-custom'], default-features = false } [features] From 40b0026a2f1c50e88909f49e8ef8c7ae074f5a9b Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 26 Dec 2024 08:58:17 -0700 Subject: [PATCH 09/10] docs: inline `std::ffi::c_str` types to `std::ffi` Rustdoc has no way to show that an item is stable, but only at a different path. `std::ffi::c_str::NulError` is not stable, but `std::ffi::NulError` is. To avoid marking these types as unstable when someone just wants to follow a link from `CString`, inline them into their stable paths. --- library/std/src/ffi/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/std/src/ffi/mod.rs b/library/std/src/ffi/mod.rs index 469136be8838a..7d7cce09a3f09 100644 --- a/library/std/src/ffi/mod.rs +++ b/library/std/src/ffi/mod.rs @@ -179,19 +179,19 @@ pub use core::ffi::{ c_ulong, c_ulonglong, c_ushort, }; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")] pub use self::c_str::FromBytesUntilNulError; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "cstr_from_bytes", since = "1.10.0")] pub use self::c_str::FromBytesWithNulError; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "cstring_from_vec_with_nul", since = "1.58.0")] pub use self::c_str::FromVecWithNulError; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "cstring_into", since = "1.7.0")] pub use self::c_str::IntoStringError; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "rust1", since = "1.0.0")] pub use self::c_str::NulError; #[doc(inline)] From fc8a541eaa4b6555d948c382b75677b0e17040fa Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 26 Dec 2024 15:51:45 -0700 Subject: [PATCH 10/10] docs: inline `core::ffi::c_str` types to `core::ffi` --- library/core/src/ffi/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs index 7a161f595f41b..5f32775822be6 100644 --- a/library/core/src/ffi/mod.rs +++ b/library/core/src/ffi/mod.rs @@ -12,10 +12,10 @@ #[doc(inline)] #[stable(feature = "core_c_str", since = "1.64.0")] pub use self::c_str::CStr; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")] pub use self::c_str::FromBytesUntilNulError; -#[doc(no_inline)] +#[doc(inline)] #[stable(feature = "core_c_str", since = "1.64.0")] pub use self::c_str::FromBytesWithNulError; use crate::fmt;