mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 12:23:22 +00:00
Add regression tests for mistyped standalone-crate
attribute
This commit is contained in:
parent
0956f69caf
commit
84d41e2fc1
16
tests/rustdoc-ui/doctest/standalone-warning-2024.rs
Normal file
16
tests/rustdoc-ui/doctest/standalone-warning-2024.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// This test checks that it will output warnings for usage of `standalone` or `standalone_crate`.
|
||||
|
||||
//@ compile-flags:--test -Zunstable-options --edition 2024
|
||||
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
|
||||
|
||||
#![deny(warnings)]
|
||||
|
||||
//! ```standalone
|
||||
//! bla
|
||||
//! ```
|
||||
//!
|
||||
//! ```standalone_crate
|
||||
//! bla
|
||||
//! ```
|
38
tests/rustdoc-ui/doctest/standalone-warning-2024.stderr
Normal file
38
tests/rustdoc-ui/doctest/standalone-warning-2024.stderr
Normal file
@ -0,0 +1,38 @@
|
||||
error: unknown attribute `standalone`
|
||||
--> $DIR/standalone-warning-2024.rs:10:1
|
||||
|
|
||||
10 | / //! ```standalone
|
||||
11 | | //! bla
|
||||
12 | | //! ```
|
||||
13 | | //!
|
||||
14 | | //! ```standalone_crate
|
||||
15 | | //! bla
|
||||
16 | | //! ```
|
||||
| |_______^
|
||||
|
|
||||
= help: there is an attribute with a similar name: `standalone-crate`
|
||||
= help: the code block will either not be tested if not marked as a rust one or the code will be run as part of the merged doctests if compatible
|
||||
note: the lint level is defined here
|
||||
--> $DIR/standalone-warning-2024.rs:8:9
|
||||
|
|
||||
8 | #![deny(warnings)]
|
||||
| ^^^^^^^^
|
||||
= note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]`
|
||||
|
||||
error: unknown attribute `standalone_crate`
|
||||
--> $DIR/standalone-warning-2024.rs:10:1
|
||||
|
|
||||
10 | / //! ```standalone
|
||||
11 | | //! bla
|
||||
12 | | //! ```
|
||||
13 | | //!
|
||||
14 | | //! ```standalone_crate
|
||||
15 | | //! bla
|
||||
16 | | //! ```
|
||||
| |_______^
|
||||
|
|
||||
= help: there is an attribute with a similar name: `standalone-crate`
|
||||
= help: the code block will either not be tested if not marked as a rust one or the code will be run as part of the merged doctests if compatible
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
10
tests/rustdoc-ui/doctest/standalone-warning.rs
Normal file
10
tests/rustdoc-ui/doctest/standalone-warning.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// This test checks that it will not output warning for usage of `standalone` or `standalone_crate`.
|
||||
//@ check-pass
|
||||
|
||||
//! ```standalone
|
||||
//! bla
|
||||
//! ```
|
||||
//!
|
||||
//! ```standalone_crate
|
||||
//! bla
|
||||
//! ```
|
Loading…
Reference in New Issue
Block a user