Allow extending a chain after raw string literal

This commit is contained in:
Seiichi Uchida 2017-06-19 22:06:08 +09:00
parent a87a4450aa
commit b99f3cb447
3 changed files with 28 additions and 3 deletions

View file

@ -111,9 +111,10 @@ pub fn trimmed_last_line_width(s: &str) -> usize {
#[inline]
pub fn last_line_extendable(s: &str) -> bool {
s.lines().last().map_or(false, |s| {
s.trim()
.chars()
.all(|c| c == ')' || c == ']' || c == '}' || c == '?')
s.ends_with("\"#") ||
s.trim()
.chars()
.all(|c| c == ')' || c == ']' || c == '}' || c == '?')
})
}

View file

@ -152,3 +152,14 @@ fn issue_1004() {
})
?;
}
fn issue1392() {
test_method(r#"
if foo {
a();
}
else {
b();
}
"#.trim());
}

View file

@ -169,3 +169,16 @@ fn issue_1004() {
in_binder(f, tcx, &ty::Binder(""), Some(tap))
})?;
}
fn issue1392() {
test_method(
r#"
if foo {
a();
}
else {
b();
}
"#.trim(),
);
}