Add a test for a codeblock with multiple invalid attributes

This commit is contained in:
Guillaume Gomez 2023-12-12 19:41:09 +01:00
parent bb0fd665a8
commit 58327c10c5
2 changed files with 39 additions and 1 deletions

View File

@ -47,3 +47,12 @@ pub fn b() {}
/// boo
/// ```
pub fn c() {}
/// b
//~^ ERROR
//~| ERROR
///
/// ```rust2018 shouldpanic
/// boo
/// ```
pub fn d() {}

View File

@ -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