Fix comment formatting wrongly assuming false invariant.
This commit is contained in:
@@ -322,25 +322,6 @@ fn utf8_hex_literal_warning() {
|
||||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn weird_comments() {
|
||||
let source_code = r#"
|
||||
// A
|
||||
|
||||
/// B
|
||||
|
||||
// C
|
||||
fn foo () {
|
||||
todo
|
||||
}
|
||||
"#;
|
||||
|
||||
assert!(matches!(
|
||||
check(parse(source_code)),
|
||||
Err((_, Error::UnexpectedDocComment { .. }))
|
||||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn discarded_let_bindings() {
|
||||
let source_code = r#"
|
||||
|
||||
@@ -638,7 +638,16 @@ fn weird_comments() {
|
||||
/// B
|
||||
|
||||
/// C
|
||||
fn bar () {
|
||||
fn foo() {
|
||||
todo
|
||||
}
|
||||
|
||||
// E
|
||||
|
||||
/// F
|
||||
|
||||
// G
|
||||
fn bar() {
|
||||
todo
|
||||
}
|
||||
"#};
|
||||
@@ -648,7 +657,15 @@ fn weird_comments() {
|
||||
|
||||
/// B
|
||||
/// C
|
||||
fn bar () {
|
||||
fn foo() {
|
||||
todo
|
||||
}
|
||||
|
||||
// E
|
||||
|
||||
// G
|
||||
/// F
|
||||
fn bar() {
|
||||
todo
|
||||
}
|
||||
"#};
|
||||
|
||||
Reference in New Issue
Block a user