Skip to content

Commit

Permalink
Add a test for a codeblock with multiple invalid attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 12, 2023
1 parent bb0fd66 commit 58327c1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/rustdoc-ui/lints/check-attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ pub fn b() {}
/// boo
/// ```
pub fn c() {}

/// b
//~^ ERROR
//~| ERROR
///
/// ```rust2018 shouldpanic
/// boo
/// ```
pub fn d() {}
31 changes: 30 additions & 1 deletion tests/rustdoc-ui/lints/check-attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,34 @@ LL | | /// ```
|
= help: there is an attribute with a similar name: `edition2018`

error: aborting due to 13 previous errors
error: unknown attribute `rust2018`
--> $DIR/check-attr.rs:51:1
|
LL | / /// b
LL | |
LL | |
LL | | ///
LL | | /// ```rust2018 shouldpanic
LL | | /// boo
LL | | /// ```
| |_______^
|
= help: there is an attribute with a similar name: `edition2018`

error: unknown attribute `shouldpanic`
--> $DIR/check-attr.rs:51:1
|
LL | / /// b
LL | |
LL | |
LL | | ///
LL | | /// ```rust2018 shouldpanic
LL | | /// boo
LL | | /// ```
| |_______^
|
= help: there is an attribute with a similar name: `should_panic`
= help: the code block will either not be tested if not marked as a rust one or won't fail if it doesn't panic when running

error: aborting due to 15 previous errors

0 comments on commit 58327c1

Please sign in to comment.