Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/rustdoc-ui/invalid-doc-attr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Ensures that invalid form of (some) doc attributes doesn't go unnoticed.

#![deny(invalid_doc_attributes)]

#[doc(hidden = "for some reason")]
//~^ ERROR didn't expect any arguments here
//~| WARN this was previously accepted by the compiler
#[doc(no_inline = "tada")]
//~^ ERROR didn't expect any arguments here
//~| WARN this was previously accepted by the compiler
pub fn foo() {}

#[doc(hidden("for some reason"))]
//~^ ERROR didn't expect any arguments here
//~| WARN this was previously accepted by the compiler
#[doc(no_inline("tada"))]
//~^ ERROR didn't expect any arguments here
//~| WARN this was previously accepted by the compiler
pub fn foo2() {}
39 changes: 39 additions & 0 deletions tests/rustdoc-ui/invalid-doc-attr.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
error: didn't expect any arguments here
--> $DIR/invalid-doc-attr.rs:5:14
|
LL | #[doc(hidden = "for some reason")]
| ^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/invalid-doc-attr.rs:3:9
|
LL | #![deny(invalid_doc_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^

error: didn't expect any arguments here
--> $DIR/invalid-doc-attr.rs:8:17
|
LL | #[doc(no_inline = "tada")]
| ^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: didn't expect any arguments here
--> $DIR/invalid-doc-attr.rs:13:13
|
LL | #[doc(hidden("for some reason"))]
| ^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: didn't expect any arguments here
--> $DIR/invalid-doc-attr.rs:16:16
|
LL | #[doc(no_inline("tada"))]
| ^^^^^^^^
|
= 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 4 previous errors

Loading