mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Merge pull request #2895 from topecongiro/issue-2787
Fix parsing '#'-hiding of rustdoc
This commit is contained in:
commit
86ee126052
@ -45,8 +45,6 @@ matrix:
|
||||
- env: INTEGRATION=rust-clippy
|
||||
# Build failure
|
||||
- env: INTEGRATION=rust-semverver
|
||||
# See: https://github.com/rust-lang-nursery/rustfmt/issues/2787
|
||||
- env: INTEGRATION=stdsimd
|
||||
|
||||
script:
|
||||
- |
|
||||
|
@ -500,7 +500,7 @@ fn rewrite_comment_inner(
|
||||
const RUSTFMT_CUSTOM_COMMENT_PREFIX: &str = "//#### ";
|
||||
|
||||
fn hide_sharp_behind_comment<'a>(s: &'a str) -> Cow<'a, str> {
|
||||
if s.trim_left().starts_with('#') {
|
||||
if s.trim_left().starts_with("# ") {
|
||||
Cow::from(format!("{}{}", RUSTFMT_CUSTOM_COMMENT_PREFIX, s))
|
||||
} else {
|
||||
Cow::from(s)
|
||||
|
Loading…
Reference in New Issue
Block a user