diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2025-04-21 18:53:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-21 18:53:20 +0000 |
| commit | ef167557b6a25659f1a66afc6ce2dd9fd326e750 (patch) | |
| tree | 2bcae831110b5c458ba276ba690d0098a93824e2 | |
| parent | df9e15e69f855b94776d5500e2f986952ed93f0a (diff) | |
| parent | c6510d9e554107a49851938ebd2ed08d95f36607 (diff) | |
| download | rust-ef167557b6a25659f1a66afc6ce2dd9fd326e750.tar.gz rust-ef167557b6a25659f1a66afc6ce2dd9fd326e750.zip | |
Rollup merge of #140107 - tshepang:rdg-push, r=jieyouxu
rustc-dev-guide subtree update r? ``@ghost``
| -rw-r--r-- | src/doc/rustc-dev-guide/rust-version | 2 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/tests/ui.md | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/doc/rustc-dev-guide/rust-version b/src/doc/rustc-dev-guide/rust-version index 67de4a98165..dc52e0928cc 100644 --- a/src/doc/rustc-dev-guide/rust-version +++ b/src/doc/rustc-dev-guide/rust-version @@ -1 +1 @@ -a7c39b68616668a45f0afd62849a1da7c8ad2516 +b8005bff3248cfc6e327faf4fa631ac49bb49ba9 diff --git a/src/doc/rustc-dev-guide/src/tests/ui.md b/src/doc/rustc-dev-guide/src/tests/ui.md index 7c4e2a0fdae..6232c8bcc0a 100644 --- a/src/doc/rustc-dev-guide/src/tests/ui.md +++ b/src/doc/rustc-dev-guide/src/tests/ui.md @@ -303,7 +303,7 @@ It should be preferred to using `error-pattern`, which is imprecise and non-exha ### `error-pattern` The `error-pattern` [directive](directives.md) can be used for runtime messages, which don't -have a specific span, or in exceptional cases for compile time messages. +have a specific span, or in exceptional cases, for compile time messages. Let's think about this test: @@ -316,7 +316,7 @@ fn main() { } ``` -We want to ensure this shows "index out of bounds" but we cannot use the `ERROR` +We want to ensure this shows "index out of bounds", but we cannot use the `ERROR` annotation since the runtime error doesn't have any span. Then it's time to use the `error-pattern` directive: @@ -333,18 +333,19 @@ fn main() { Use of `error-pattern` is not recommended in general. For strict testing of compile time output, try to use the line annotations `//~` as much as -possible, including `//~?` annotations for diagnostics without span. +possible, including `//~?` annotations for diagnostics without spans. If the compile time output is target dependent or too verbose, use directive `//@ dont-require-annotations: <diagnostic-kind>` to make the line annotation checking -non-exhaustive, some of the compiler messages can stay uncovered by annotations in this mode. +non-exhaustive. +Some of the compiler messages can stay uncovered by annotations in this mode. -For checking runtime output `//@ check-run-results` may be preferable. +For checking runtime output, `//@ check-run-results` may be preferable. Only use `error-pattern` if none of the above works. Line annotations `//~` are still checked in tests using `error-pattern`. -In exceptional cases use `//@ compile-flags: --error-format=human` to opt out of these checks. +In exceptional cases, use `//@ compile-flags: --error-format=human` to opt out of these checks. ### Diagnostic kinds (error levels) |
