summaryrefslogtreecommitdiffstats
path: root/tests/ui/stability-attribute
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/stability-attribute')
-rw-r--r--tests/ui/stability-attribute/auxiliary/default_body.rs4
-rw-r--r--tests/ui/stability-attribute/default-body-stability-err.rs1
-rw-r--r--tests/ui/stability-attribute/default-body-stability-err.stderr14
-rw-r--r--tests/ui/stability-attribute/default-body-stability-ok-impls.rs2
-rw-r--r--tests/ui/stability-attribute/stability-in-private-module.stderr4
5 files changed, 22 insertions, 3 deletions
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