rustdoc: fix diagnostic with mixed code block styles
This commit is contained in:
parent
ef54f57c5b
commit
fb387088e2
@ -931,7 +931,10 @@ pub fn markdown_links(md: &str) -> Vec<(String, Option<Range<usize>>)> {
|
||||
is_fenced = true;
|
||||
previous_offset + fence_idx
|
||||
}
|
||||
None => offset,
|
||||
None => {
|
||||
is_fenced = false;
|
||||
offset
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -74,3 +74,11 @@ pub fn empty_rust() {}
|
||||
///
|
||||
/// ```
|
||||
pub fn empty_rust_with_whitespace() {}
|
||||
|
||||
/// ```
|
||||
/// let x = 1;
|
||||
/// ```
|
||||
///
|
||||
/// \____/
|
||||
///
|
||||
pub fn indent_after_fenced() {}
|
||||
|
@ -201,6 +201,24 @@ help: mark blocks that do not contain Rust code as text
|
||||
LL | /// ```text
|
||||
| ^^^^^^^
|
||||
|
||||
error: unknown start of token: \
|
||||
--> <doctest>:1:1
|
||||
|
|
||||
1 | \____/
|
||||
| ^
|
||||
|
||||
warning: could not parse code block as Rust code
|
||||
--> $DIR/invalid-syntax.rs:82:9
|
||||
|
|
||||
LL | /// \____/
|
||||
| ^^^^^^
|
||||
|
||||
error: unknown start of token: \
|
||||
--> <rustdoc-highlighting>:1:1
|
||||
|
|
||||
1 | \____/
|
||||
| ^
|
||||
|
||||
error: unknown start of token: \
|
||||
--> <rustdoc-highlighting>:1:1
|
||||
|
|
||||
|
Loading…
Reference in New Issue
Block a user