Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 98aa20b

Browse files
committedDec 12, 2023
Add test for rustX codeblock attribute
1 parent d3cb25f commit 98aa20b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
 

‎tests/rustdoc-ui/lints/check-attr.rs

+8
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ pub fn foobar() {}
3939
/// boo
4040
/// ```
4141
pub fn b() {}
42+
43+
/// b
44+
//~^ ERROR
45+
///
46+
/// ```rust2018
47+
/// boo
48+
/// ```
49+
pub fn c() {}

‎tests/rustdoc-ui/lints/check-attr.stderr

+12-1
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,16 @@ LL | | /// ```
171171
|
172172
= 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
173173

174-
error: aborting due to 12 previous errors
174+
error: unknown attribute `rust2018`. Did you mean `edition2018`?
175+
--> $DIR/check-attr.rs:43:1
176+
|
177+
LL | / /// b
178+
LL | |
179+
LL | | ///
180+
LL | | /// ```rust2018
181+
LL | | /// boo
182+
LL | | /// ```
183+
| |_______^
184+
185+
error: aborting due to 13 previous errors
175186

0 commit comments

Comments
 (0)
Failed to load comments.