about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-17 22:55:06 +0100
committerGitHub <noreply@github.com>2022-03-17 22:55:06 +0100
commit0c73b252eb024c2c9b16e2a03e0e2756e14b62bf (patch)
tree2567635f9812594a4c7f701611e08a5ada68fc68 /src/test
parent270a41c33e6282933ddb3ef405e7089f3e92ea07 (diff)
parente4f1179fa6b044adfd52d45ce35bfe4f5ad04c8f (diff)
Rollup merge of #94982 - skippy10110:deprecated_safe, r=Dylan-DPC
Add deprecated_safe feature gate and attribute, cc #94978
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/feature-gates/feature-gate-deprecated_safe.rs7
-rw-r--r--src/test/ui/feature-gates/feature-gate-deprecated_safe.stderr21
2 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-deprecated_safe.rs b/src/test/ui/feature-gates/feature-gate-deprecated_safe.rs
new file mode 100644
index 00000000000..d5f4a4705b9
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-deprecated_safe.rs
@@ -0,0 +1,7 @@
+#[deprecated_safe(since = "TBD", note = "...")] //~ ERROR: the `#[deprecated_safe]` attribute is an experimental feature
+unsafe fn deprecated_safe_fn() {}
+
+#[deprecated_safe(since = "TBD", note = "...")] //~ ERROR: the `#[deprecated_safe]` attribute is an experimental feature
+unsafe trait DeprecatedSafeTrait {}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-deprecated_safe.stderr b/src/test/ui/feature-gates/feature-gate-deprecated_safe.stderr
new file mode 100644
index 00000000000..5e98a1faaa3
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-deprecated_safe.stderr
@@ -0,0 +1,21 @@
+error[E0658]: the `#[deprecated_safe]` attribute is an experimental feature
+  --> $DIR/feature-gate-deprecated_safe.rs:1:1
+   |
+LL | #[deprecated_safe(since = "TBD", note = "...")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94978 <https://github.com/rust-lang/rust/issues/94978> for more information
+   = help: add `#![feature(deprecated_safe)]` to the crate attributes to enable
+
+error[E0658]: the `#[deprecated_safe]` attribute is an experimental feature
+  --> $DIR/feature-gate-deprecated_safe.rs:4:1
+   |
+LL | #[deprecated_safe(since = "TBD", note = "...")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #94978 <https://github.com/rust-lang/rust/issues/94978> for more information
+   = help: add `#![feature(deprecated_safe)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0658`.