]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs
Rollup merge of #100451 - hovinen:no-panic-on-result-err-in-test, r=Mark-Simulacrum
[rust.git] / src / test / ui / lexer / lex-bare-cr-string-literal-doc-comment.rs
1 // ignore-tidy-cr
2
3 /// doc comment with bare CR: '\r'
4 pub fn foo() {}
5 //~^^ ERROR: bare CR not allowed in doc-comment
6
7 /** block doc comment with bare CR: '\r' */
8 pub fn bar() {}
9 //~^^ ERROR: bare CR not allowed in block doc-comment
10
11 fn main() {
12     //! doc comment with bare CR: '\r'
13     //~^ ERROR: bare CR not allowed in doc-comment
14
15     /*! block doc comment with bare CR: '\r' */
16     //~^ ERROR: bare CR not allowed in block doc-comment
17
18     // the following string literal has a bare CR in it
19     let _s = "foo\rbar"; //~ ERROR: bare CR not allowed in string
20
21     // the following string literal has a bare CR in it
22     let _s = r"bar\rfoo"; //~ ERROR: bare CR not allowed in raw string
23
24     // the following string literal has a bare CR in it
25     let _s = "foo\\rbar"; //~ ERROR: unknown character escape: `\r`
26 }