Add test for #![doc(test(...)] with literal parameter

This commit is contained in:
Obei Sideg 2023-05-29 22:30:09 +03:00
parent 33eef8221d
commit 70bbcceaec
3 changed files with 26 additions and 2 deletions

View File

@ -211,11 +211,11 @@ passes_doc_keyword_not_mod =
passes_doc_keyword_only_impl =
`#[doc(keyword = "...")]` should be used on impl blocks
passes_doc_test_literal = `#![doc(test(...)]` does not take a literal
passes_doc_test_takes_list =
`#[doc(test(...)]` takes a list of attributes
passes_doc_test_literal = `#![doc(test(...)]` does not take a literal
passes_doc_test_unknown =
unknown `doc(test)` attribute `{$path}`

View File

@ -0,0 +1,7 @@
#![deny(warnings)]
#![doc(test(""))]
//~^ ERROR `#![doc(test(...)]` does not take a literal
//~^^ WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
fn main() {}

View File

@ -0,0 +1,17 @@
error: `#![doc(test(...)]` does not take a literal
--> $DIR/doc-test-literal.rs:3:13
|
LL | #![doc(test(""))]
| ^^
|
= 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-test-literal.rs:1:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
error: aborting due to previous error