diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-03-08 01:27:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-08 01:27:20 -0500 |
| commit | 720eacf08693418940e857379e1593b6891a09c3 (patch) | |
| tree | 39100b87651a41ed803158284aa72f9f7d2a0c68 /library/alloc/src/borrow.rs | |
| parent | 20f0108ada90e37c2350ad68fdc6afe56f51539d (diff) | |
| parent | 22d0440993d6eab6e9faf35f729e2d52ba6d72a6 (diff) | |
| download | rust-720eacf08693418940e857379e1593b6891a09c3.tar.gz rust-720eacf08693418940e857379e1593b6891a09c3.zip | |
Rollup merge of #136642 - bjorn3:separate_alloctest_crate, r=cuviper
Put the alloc unit tests in a separate alloctests package Same rationale as https://github.com/rust-lang/rust/pull/135937. This PR has some extra complexity though as a decent amount of tests are testing internal implementation details rather than the public api. As such I opted to include the modules containing the types under test using `#[path]` into the alloctests package. This means that those modules still need `#[cfg(test)]`, but the rest of liballoc no longer need it.
Diffstat (limited to 'library/alloc/src/borrow.rs')
| -rw-r--r-- | library/alloc/src/borrow.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs index 17dad3277b9..07f51b7614f 100644 --- a/library/alloc/src/borrow.rs +++ b/library/alloc/src/borrow.rs @@ -32,7 +32,7 @@ where /// implementing the `Clone` trait. But `Clone` works only for going from `&T` /// to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data /// from any borrow of a given type. -#[cfg_attr(not(test), rustc_diagnostic_item = "ToOwned")] +#[rustc_diagnostic_item = "ToOwned"] #[stable(feature = "rust1", since = "1.0.0")] pub trait ToOwned { /// The resulting type after obtaining ownership. @@ -54,7 +54,7 @@ pub trait ToOwned { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "cloning is often expensive and is not expected to have side effects"] - #[cfg_attr(not(test), rustc_diagnostic_item = "to_owned_method")] + #[rustc_diagnostic_item = "to_owned_method"] fn to_owned(&self) -> Self::Owned; /// Uses borrowed data to replace owned data, usually by cloning. @@ -175,7 +175,7 @@ where /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[cfg_attr(not(test), rustc_diagnostic_item = "Cow")] +#[rustc_diagnostic_item = "Cow"] pub enum Cow<'a, B: ?Sized + 'a> where B: ToOwned, |
