From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/stability-attribute/auxiliary/default_body.rs | 4 ++++ tests/ui/stability-attribute/default-body-stability-err.rs | 1 + .../stability-attribute/default-body-stability-err.stderr | 14 ++++++++++++-- .../stability-attribute/default-body-stability-ok-impls.rs | 2 ++ .../stability-attribute/stability-in-private-module.stderr | 4 +++- 5 files changed, 22 insertions(+), 3 deletions(-) (limited to 'tests/ui/stability-attribute') diff --git a/tests/ui/stability-attribute/auxiliary/default_body.rs b/tests/ui/stability-attribute/auxiliary/default_body.rs index 3a177419d..2f315eb1b 100644 --- a/tests/ui/stability-attribute/auxiliary/default_body.rs +++ b/tests/ui/stability-attribute/auxiliary/default_body.rs @@ -11,6 +11,10 @@ pub trait JustTrait { #[rustc_default_body_unstable(feature = "fun_default_body", issue = "none")] #[stable(feature = "stable_feature", since = "1.0.0")] fn fun() {} + + #[rustc_default_body_unstable(feature = "fun_default_body", issue = "none", reason = "reason")] + #[stable(feature = "stable_feature", since = "1.0.0")] + fn fun2() {} } #[rustc_must_implement_one_of(eq, neq)] diff --git a/tests/ui/stability-attribute/default-body-stability-err.rs b/tests/ui/stability-attribute/default-body-stability-err.rs index ecb281bcc..d1a359768 100644 --- a/tests/ui/stability-attribute/default-body-stability-err.rs +++ b/tests/ui/stability-attribute/default-body-stability-err.rs @@ -10,6 +10,7 @@ struct Type; impl JustTrait for Type {} //~^ ERROR not all trait items implemented, missing: `CONSTANT` [E0046] //~| ERROR not all trait items implemented, missing: `fun` [E0046] +//~| ERROR not all trait items implemented, missing: `fun2` [E0046] impl Equal for Type { //~^ ERROR not all trait items implemented, missing: `eq` [E0046] diff --git a/tests/ui/stability-attribute/default-body-stability-err.stderr b/tests/ui/stability-attribute/default-body-stability-err.stderr index ef666f30f..12ec9ea3a 100644 --- a/tests/ui/stability-attribute/default-body-stability-err.stderr +++ b/tests/ui/stability-attribute/default-body-stability-err.stderr @@ -18,8 +18,18 @@ LL | impl JustTrait for Type {} = note: use of unstable library feature 'fun_default_body' = help: add `#![feature(fun_default_body)]` to the crate attributes to enable +error[E0046]: not all trait items implemented, missing: `fun2` + --> $DIR/default-body-stability-err.rs:10:1 + | +LL | impl JustTrait for Type {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: default implementation of `fun2` is unstable + = note: use of unstable library feature 'fun_default_body': reason + = help: add `#![feature(fun_default_body)]` to the crate attributes to enable + error[E0046]: not all trait items implemented, missing: `eq` - --> $DIR/default-body-stability-err.rs:14:1 + --> $DIR/default-body-stability-err.rs:15:1 | LL | / impl Equal for Type { LL | | @@ -33,6 +43,6 @@ LL | | } = note: use of unstable library feature 'eq_default_body' = help: add `#![feature(eq_default_body)]` to the crate attributes to enable -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0046`. diff --git a/tests/ui/stability-attribute/default-body-stability-ok-impls.rs b/tests/ui/stability-attribute/default-body-stability-ok-impls.rs index e1f5c0170..b29d45256 100644 --- a/tests/ui/stability-attribute/default-body-stability-ok-impls.rs +++ b/tests/ui/stability-attribute/default-body-stability-ok-impls.rs @@ -12,6 +12,8 @@ impl JustTrait for Type { const CONSTANT: usize = 1; fn fun() {} + + fn fun2() {} } impl Equal for Type { diff --git a/tests/ui/stability-attribute/stability-in-private-module.stderr b/tests/ui/stability-attribute/stability-in-private-module.stderr index 2f02a2496..cc8758714 100644 --- a/tests/ui/stability-attribute/stability-in-private-module.stderr +++ b/tests/ui/stability-attribute/stability-in-private-module.stderr @@ -2,7 +2,9 @@ error[E0603]: module `thread_info` is private --> $DIR/stability-in-private-module.rs:2:26 | LL | let _ = std::thread::thread_info::current_thread(); - | ^^^^^^^^^^^ private module + | ^^^^^^^^^^^ -------------- function `current_thread` is not publicly re-exported + | | + | private module | note: the module `thread_info` is defined here --> $SRC_DIR/std/src/thread/mod.rs:LL:COL -- cgit v1.2.3