summaryrefslogtreecommitdiffstats
path: root/tests/ui/rustdoc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rustdoc')
-rw-r--r--tests/ui/rustdoc/doc-primitive.rs8
-rw-r--r--tests/ui/rustdoc/doc-primitive.stderr16
-rw-r--r--tests/ui/rustdoc/feature-gate-doc_primitive.rs6
-rw-r--r--tests/ui/rustdoc/feature-gate-doc_primitive.stderr15
4 files changed, 33 insertions, 12 deletions
diff --git a/tests/ui/rustdoc/doc-primitive.rs b/tests/ui/rustdoc/doc-primitive.rs
new file mode 100644
index 000000000..4336961e3
--- /dev/null
+++ b/tests/ui/rustdoc/doc-primitive.rs
@@ -0,0 +1,8 @@
+#![deny(invalid_doc_attributes)]
+
+#[doc(primitive = "foo")]
+//~^ ERROR unknown `doc` attribute `primitive`
+//~| WARN
+mod bar {}
+
+fn main() {}
diff --git a/tests/ui/rustdoc/doc-primitive.stderr b/tests/ui/rustdoc/doc-primitive.stderr
new file mode 100644
index 000000000..d61eb3816
--- /dev/null
+++ b/tests/ui/rustdoc/doc-primitive.stderr
@@ -0,0 +1,16 @@
+error: unknown `doc` attribute `primitive`
+ --> $DIR/doc-primitive.rs:3:7
+ |
+LL | #[doc(primitive = "foo")]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+note: the lint level is defined here
+ --> $DIR/doc-primitive.rs:1:9
+ |
+LL | #![deny(invalid_doc_attributes)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/rustdoc/feature-gate-doc_primitive.rs b/tests/ui/rustdoc/feature-gate-doc_primitive.rs
index 18e99e72f..78fcd9075 100644
--- a/tests/ui/rustdoc/feature-gate-doc_primitive.rs
+++ b/tests/ui/rustdoc/feature-gate-doc_primitive.rs
@@ -1,7 +1,5 @@
-// check-pass
-#[doc(primitive = "usize")]
-//~^ WARNING `doc(primitive)` should never have been stable
-//~| WARNING hard error in a future release
+#[rustc_doc_primitive = "usize"]
+//~^ ERROR `rustc_doc_primitive` is a rustc internal attribute
/// Some docs
mod usize {}
diff --git a/tests/ui/rustdoc/feature-gate-doc_primitive.stderr b/tests/ui/rustdoc/feature-gate-doc_primitive.stderr
index 194b2d87d..592088067 100644
--- a/tests/ui/rustdoc/feature-gate-doc_primitive.stderr
+++ b/tests/ui/rustdoc/feature-gate-doc_primitive.stderr
@@ -1,12 +1,11 @@
-warning: `doc(primitive)` should never have been stable
- --> $DIR/feature-gate-doc_primitive.rs:2:7
+error[E0658]: `rustc_doc_primitive` is a rustc internal attribute
+ --> $DIR/feature-gate-doc_primitive.rs:1:1
|
-LL | #[doc(primitive = "usize")]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #[rustc_doc_primitive = "usize"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
- = note: `#[warn(invalid_doc_attributes)]` on by default
+ = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
-warning: 1 warning emitted
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0658`.