Merge pull request #2895 from topecongiro/issue-2787

Fix parsing '#'-hiding of rustdoc
This commit is contained in:
Seiichi Uchida 2018-08-05 11:43:43 +09:00 committed by GitHub
commit 86ee126052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

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

View File

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