mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Add test for #![doc(test(...)]
with literal parameter
This commit is contained in:
parent
33eef8221d
commit
70bbcceaec
@ -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}`
|
||||
|
||||
|
7
tests/ui/attributes/doc-test-literal.rs
Normal file
7
tests/ui/attributes/doc-test-literal.rs
Normal 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() {}
|
17
tests/ui/attributes/doc-test-literal.stderr
Normal file
17
tests/ui/attributes/doc-test-literal.stderr
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user