Skip to content

Commit 1a811d7

Browse files
committed
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
2 parents e365ad4 + f2d99f3 commit 1a811d7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: src/tests/ui.md

+15
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ several ways to match the message with the line (see the examples below):
202202
* `~|`: Associates the error level and message with the *same* line as the
203203
*previous comment*. This is more convenient than using multiple carets when
204204
there are multiple messages associated with the same line.
205+
* `~v`: Associates the error level and message with the *next* error
206+
annotation line. Each symbol (`v`) that you add adds a line to this, so `~vvv`
207+
is three lines below the error annotation line.
205208
* `~?`: Used to match error levels and messages with errors not having line
206209
information. These can be placed on any line in the test file, but are
207210
conventionally placed at the end.
@@ -273,6 +276,18 @@ fn main() {
273276
//~| ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields [E0023]
274277
```
275278

279+
#### Positioned above error line
280+
281+
Use the `//~v` idiom with number of v's in the string to indicate the number
282+
of lines below. This is typically used in lexer or parser tests matching on errors like unclosed
283+
delimiter or unclosed literal happening at the end of file.
284+
285+
```rust,ignore
286+
// ignore-tidy-trailing-newlines
287+
//~v ERROR this file contains an unclosed delimiter
288+
fn main((ؼ
289+
```
290+
276291
#### Error without line information
277292

278293
Use `//~?` to match an error without line information.

0 commit comments

Comments
 (0)