Skip to content

Commit 2f09023

Browse files
committed
Auto merge of #144440 - matthiaskrgr:rollup-peb88gb, r=matthiaskrgr
Rollup of 12 pull requests Successful merges: - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro) - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test) - rust-lang/rust#143424 (clippy fix: rely on autoderef) - rust-lang/rust#143970 (Update core::mem::copy documentation) - rust-lang/rust#143979 (Test fixes for Arm64EC Windows) - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures) - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other) - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds) - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`) - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`) - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it) - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5088611 + 765f77a commit 2f09023

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tests/ui.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ fn main((ؼ
309309

310310
Use `//~?` to match an error without line information.
311311
`//~?` is precise and will not match errors if their line information is available.
312-
It should be preferred to using `error-pattern`, which is imprecise and non-exhaustive.
312+
For tests wishing to match against compiler diagnostics, error annotations should
313+
be preferred over //@ error-pattern, //@ error-pattern is imprecise and non-exhaustive.
313314

314315
```rust,ignore
315316
//@ compile-flags: --print yyyy
@@ -347,8 +348,6 @@ fn main() {
347348
}
348349
```
349350

350-
Use of `error-pattern` is not recommended in general.
351-
352351
For strict testing of compile time output, try to use the line annotations `//~` as much as
353352
possible, including `//~?` annotations for diagnostics without spans.
354353

@@ -359,7 +358,8 @@ Some of the compiler messages can stay uncovered by annotations in this mode.
359358

360359
For checking runtime output, `//@ check-run-results` may be preferable.
361360

362-
Only use `error-pattern` if none of the above works.
361+
Only use `error-pattern` if none of the above works, such as when finding a
362+
specific string pattern in a runtime panic output.
363363

364364
Line annotations `//~` and `error-pattern` are compatible and can be used in the same test.
365365

0 commit comments

Comments
 (0)