about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-03 21:35:32 +0000
committerbors <bors@rust-lang.org>2021-03-03 21:35:32 +0000
commit1c77a1fa3ca574f2a40056f64d498db8efe0d8a8 (patch)
tree0127748de124ff97776fb5691502a305fc736490 /src
parent476acbf1e9965b5e95c90f0d7d658709812b7003 (diff)
parent4b2e4e69dfbf75222ae547659e999cee05833de9 (diff)
downloadrust-1c77a1fa3ca574f2a40056f64d498db8efe0d8a8.tar.gz
rust-1c77a1fa3ca574f2a40056f64d498db8efe0d8a8.zip
Auto merge of #82702 - jyn514:downgrade-err, r=Manishearth
Change error about unknown attributes to a warning

Hard errors should go through a future-compatibility phase first, especially since these attributes only have no effect and don't actively cause bugs.

Follow-up to https://github.com/rust-lang/rust/pull/82662. Fixes ecosystem breakage like https://github.com/rust-lang/rust-clippy/issues/6832.

r? `@GuillaumeGomez`
Diffstat (limited to 'src')
-rw-r--r--src/test/rustdoc-ui/doc-attr.rs10
-rw-r--r--src/test/rustdoc-ui/doc-attr.stderr13
-rw-r--r--src/test/ui/attributes/doc-attr.rs10
-rw-r--r--src/test/ui/attributes/doc-attr.stderr13
4 files changed, 38 insertions, 8 deletions
diff --git a/src/test/rustdoc-ui/doc-attr.rs b/src/test/rustdoc-ui/doc-attr.rs
index 37c69a214b8..3519b5707b3 100644
--- a/src/test/rustdoc-ui/doc-attr.rs
+++ b/src/test/rustdoc-ui/doc-attr.rs
@@ -1,5 +1,11 @@
 #![crate_type = "lib"]
-#![doc(as_ptr)] //~ ERROR
+#![deny(unused_attributes)]
+//~^ NOTE lint level is defined here
+#![doc(as_ptr)]
+//~^ ERROR unknown `doc` attribute
+//~| WARNING will become a hard error in a future release
 
-#[doc(as_ptr)] //~ ERROR
+#[doc(as_ptr)]
+//~^ ERROR unknown `doc` attribute
+//~| WARNING will become a hard error in a future release
 pub fn foo() {}
diff --git a/src/test/rustdoc-ui/doc-attr.stderr b/src/test/rustdoc-ui/doc-attr.stderr
index 17bc3d6a45a..9666db2b10e 100644
--- a/src/test/rustdoc-ui/doc-attr.stderr
+++ b/src/test/rustdoc-ui/doc-attr.stderr
@@ -1,14 +1,23 @@
 error: unknown `doc` attribute `as_ptr`
-  --> $DIR/doc-attr.rs:4:7
+  --> $DIR/doc-attr.rs:8:7
    |
 LL | #[doc(as_ptr)]
    |       ^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/doc-attr.rs:2:9
+   |
+LL | #![deny(unused_attributes)]
+   |         ^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 error: unknown `doc` attribute `as_ptr`
-  --> $DIR/doc-attr.rs:2:8
+  --> $DIR/doc-attr.rs:4:8
    |
 LL | #![doc(as_ptr)]
    |        ^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/attributes/doc-attr.rs b/src/test/ui/attributes/doc-attr.rs
index 37c69a214b8..3519b5707b3 100644
--- a/src/test/ui/attributes/doc-attr.rs
+++ b/src/test/ui/attributes/doc-attr.rs
@@ -1,5 +1,11 @@
 #![crate_type = "lib"]
-#![doc(as_ptr)] //~ ERROR
+#![deny(unused_attributes)]
+//~^ NOTE lint level is defined here
+#![doc(as_ptr)]
+//~^ ERROR unknown `doc` attribute
+//~| WARNING will become a hard error in a future release
 
-#[doc(as_ptr)] //~ ERROR
+#[doc(as_ptr)]
+//~^ ERROR unknown `doc` attribute
+//~| WARNING will become a hard error in a future release
 pub fn foo() {}
diff --git a/src/test/ui/attributes/doc-attr.stderr b/src/test/ui/attributes/doc-attr.stderr
index 17bc3d6a45a..9666db2b10e 100644
--- a/src/test/ui/attributes/doc-attr.stderr
+++ b/src/test/ui/attributes/doc-attr.stderr
@@ -1,14 +1,23 @@
 error: unknown `doc` attribute `as_ptr`
-  --> $DIR/doc-attr.rs:4:7
+  --> $DIR/doc-attr.rs:8:7
    |
 LL | #[doc(as_ptr)]
    |       ^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/doc-attr.rs:2:9
+   |
+LL | #![deny(unused_attributes)]
+   |         ^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 error: unknown `doc` attribute `as_ptr`
-  --> $DIR/doc-attr.rs:2:8
+  --> $DIR/doc-attr.rs:4:8
    |
 LL | #![doc(as_ptr)]
    |        ^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 error: aborting due to 2 previous errors