diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-12-12 14:27:35 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-12-12 15:42:49 +0100 |
| commit | 98aa20b0a7ee519b23f37d76c1d093f50c43d863 (patch) | |
| tree | 1c3c3e5eae06c00c6b2f955db7096c52920c1028 | |
| parent | d3cb25f4cfc15d0c8a13836d52352d1c3225ebd6 (diff) | |
| download | rust-98aa20b0a7ee519b23f37d76c1d093f50c43d863.tar.gz rust-98aa20b0a7ee519b23f37d76c1d093f50c43d863.zip | |
Add test for `rustX` codeblock attribute
| -rw-r--r-- | tests/rustdoc-ui/lints/check-attr.rs | 8 | ||||
| -rw-r--r-- | tests/rustdoc-ui/lints/check-attr.stderr | 13 |
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/rustdoc-ui/lints/check-attr.rs b/tests/rustdoc-ui/lints/check-attr.rs index 0b3f7bedda5..38f5b3851d0 100644 --- a/tests/rustdoc-ui/lints/check-attr.rs +++ b/tests/rustdoc-ui/lints/check-attr.rs @@ -39,3 +39,11 @@ pub fn foobar() {} /// boo /// ``` pub fn b() {} + +/// b +//~^ ERROR +/// +/// ```rust2018 +/// boo +/// ``` +pub fn c() {} diff --git a/tests/rustdoc-ui/lints/check-attr.stderr b/tests/rustdoc-ui/lints/check-attr.stderr index f66e63ab727..cd2f1eea7ce 100644 --- a/tests/rustdoc-ui/lints/check-attr.stderr +++ b/tests/rustdoc-ui/lints/check-attr.stderr @@ -171,5 +171,16 @@ LL | | /// ``` | = help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function -error: aborting due to 12 previous errors +error: unknown attribute `rust2018`. Did you mean `edition2018`? + --> $DIR/check-attr.rs:43:1 + | +LL | / /// b +LL | | +LL | | /// +LL | | /// ```rust2018 +LL | | /// boo +LL | | /// ``` + | |_______^ + +error: aborting due to 13 previous errors |
