Auto merge of #139119 - matthiaskrgr:rollup-7l2ri0f, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #137928 (stabilize const_cell) - #138431 (Fix `uclibc` LLVM target triples) - #138832 (Start using `with_native_path` in `std::sys::fs`) - #139081 (std: deduplicate `errno` accesses) - #139100 (compiletest: Support matching diagnostics on lines below) - #139105 (`BackendRepr::is_signed`: comment why this may panics) - #139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
1a811d76c4
|
|
@ -202,6 +202,9 @@ several ways to match the message with the line (see the examples below):
|
||||||
* `~|`: Associates the error level and message with the *same* line as the
|
* `~|`: Associates the error level and message with the *same* line as the
|
||||||
*previous comment*. This is more convenient than using multiple carets when
|
*previous comment*. This is more convenient than using multiple carets when
|
||||||
there are multiple messages associated with the same line.
|
there are multiple messages associated with the same line.
|
||||||
|
* `~v`: Associates the error level and message with the *next* error
|
||||||
|
annotation line. Each symbol (`v`) that you add adds a line to this, so `~vvv`
|
||||||
|
is three lines below the error annotation line.
|
||||||
* `~?`: Used to match error levels and messages with errors not having line
|
* `~?`: Used to match error levels and messages with errors not having line
|
||||||
information. These can be placed on any line in the test file, but are
|
information. These can be placed on any line in the test file, but are
|
||||||
conventionally placed at the end.
|
conventionally placed at the end.
|
||||||
|
|
@ -273,6 +276,18 @@ fn main() {
|
||||||
//~| ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields [E0023]
|
//~| ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields [E0023]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Positioned above error line
|
||||||
|
|
||||||
|
Use the `//~v` idiom with number of v's in the string to indicate the number
|
||||||
|
of lines below. This is typically used in lexer or parser tests matching on errors like unclosed
|
||||||
|
delimiter or unclosed literal happening at the end of file.
|
||||||
|
|
||||||
|
```rust,ignore
|
||||||
|
// ignore-tidy-trailing-newlines
|
||||||
|
//~v ERROR this file contains an unclosed delimiter
|
||||||
|
fn main((ؼ
|
||||||
|
```
|
||||||
|
|
||||||
#### Error without line information
|
#### Error without line information
|
||||||
|
|
||||||
Use `//~?` to match an error without line information.
|
Use `//~?` to match an error without line information.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue