mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-01 00:36:54 +00:00

The RFC only limits hyphens at the beginning of lines and not if they are indented or embedded in other content. Sticking to that approach was confirmed by the T-lang liason at https://github.com/rust-lang/rust/issues/141367#issuecomment-3202217544 There is a regression in error message quality which I'm leaving for someone if they feel this needs improving.
15 lines
338 B
Rust
15 lines
338 B
Rust
---cargo
|
|
//~^ ERROR: unclosed frontmatter
|
|
|
|
//@ compile-flags: --crate-type lib
|
|
|
|
#![feature(frontmatter)]
|
|
|
|
fn foo(x: i32) -> i32 {
|
|
---x
|
|
//~^ WARNING: use of a double negation [double_negations]
|
|
}
|
|
|
|
// this test is for the weird case that valid Rust code can have three dashes
|
|
// within them and get treated as a frontmatter close.
|