-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiletest: Support matching diagnostics on lines below #139100
Conversation
The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. cc @BoxyUwU, @jieyouxu, @Kobzol Some changes occurred in src/tools/compiletest cc @jieyouxu |
r? jieyouxu |
I'll take a look tmrw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually nvm I looked at this today.
Thanks, this is a very nice improvement!
//@ error-pattern: this file contains an unclosed delimiter | ||
//@ error-pattern: mismatched closing delimiter: `]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nice 👍
@bors r+ rollup |
compiletest: Support matching diagnostics on lines below Using `//~vvv ERROR`. This is not needed often, but it's easy to support, and it allows to eliminate a class of `error-pattern`s that cannot be eliminated in any other way. See the diff for the examples of such patterns coming from parser. Some of them can be matched by `//~ ERROR` or `//~^ ERROR` as well (when the final newline is allowed), but it changes the shape of reported spans, so I chose to keep the spans by using `//~v ERROR`.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139060 (replace commit placeholder in vendor status with actual commit) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139100 - petrochenkov:errbelow, r=jieyouxu compiletest: Support matching diagnostics on lines below Using `//~vvv ERROR`. This is not needed often, but it's easy to support, and it allows to eliminate a class of `error-pattern`s that cannot be eliminated in any other way. See the diff for the examples of such patterns coming from parser. Some of them can be matched by `//~ ERROR` or `//~^ ERROR` as well (when the final newline is allowed), but it changes the shape of reported spans, so I chose to keep the spans by using `//~v ERROR`.
compiletest: Require `//~` annotations even if `error-pattern` is specified This is continuation of rust-lang#138865 with some help from rust-lang#139100. `error-pattern` annotations that duplicate the newly added `//~` annotations are removed, other `error-pattern`s are not touched yet. In exceptional cases `//@ compile-flags: --error-format=human` can be used to opt out of these checks. In this PR I only had to use the opt out 3 times: - `tests/ui/parser/utf16-{be,le}-without-bom.rs` - there are too many errors that are nearly identical (modulo location), because an error is reported on every second symbol - `tests/ui-fulldeps/missing-rustc-driver-error.rs` - the errors list various rustc crate dependencies and may unexpectedly invalidate on random rustc changes
compiletest: Require `//~` annotations even if `error-pattern` is specified This is continuation of rust-lang#138865 with some help from rust-lang#139100. `error-pattern` annotations that duplicate the newly added `//~` annotations are removed, other `error-pattern`s are not touched yet. In exceptional cases `//@ compile-flags: --error-format=human` can be used to opt out of these checks. In this PR I only had to use the opt out 3 times: - `tests/ui/parser/utf16-{be,le}-without-bom.rs` - there are too many errors that are nearly identical (modulo location), because an error is reported on every second symbol - `tests/ui-fulldeps/missing-rustc-driver-error.rs` - the errors list various rustc crate dependencies and may unexpectedly invalidate on random rustc changes
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
compiletest: Require `//~` annotations even if `error-pattern` is specified This is continuation of rust-lang#138865 with some help from rust-lang#139100. `error-pattern` annotations that duplicate the newly added `//~` annotations are removed, other `error-pattern`s are not touched yet. In exceptional cases `//@ compile-flags: --error-format=human` can be used to opt out of these checks. In this PR I only had to use the opt out 3 times: - `tests/ui/parser/utf16-{be,le}-without-bom.rs` - there are too many errors that are nearly identical (modulo location), because an error is reported on every second symbol - `tests/ui-fulldeps/missing-rustc-driver-error.rs` - the errors list various rustc crate dependencies and may unexpectedly invalidate on random rustc changes
compiletest: Require `//~` annotations even if `error-pattern` is specified This is continuation of rust-lang#138865 with some help from rust-lang#139100. `error-pattern` annotations that duplicate the newly added `//~` annotations are removed, other `error-pattern`s are not touched yet. In exceptional cases `//@ compile-flags: --error-format=human` can be used to opt out of these checks. In this PR I only had to use the opt out 3 times: - `tests/ui/parser/utf16-{be,le}-without-bom.rs` - there are too many errors that are nearly identical (modulo location), because an error is reported on every second symbol - `tests/ui-fulldeps/missing-rustc-driver-error.rs` - the errors list various rustc crate dependencies and may unexpectedly invalidate on random rustc changes
Using
//~vvv ERROR
.This is not needed often, but it's easy to support, and it allows to eliminate a class of
error-pattern
s that cannot be eliminated in any other way.See the diff for the examples of such patterns coming from parser.
Some of them can be matched by
//~ ERROR
or//~^ ERROR
as well (when the final newline is allowed), but it changes the shape of reported spans, so I chose to keep the spans by using//~v ERROR
.