mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Move diagnostic kind name to the end of the diagnostic. (#4437)
Also surround it in square brackets rather than parentheses. This matches the format used by Clang and GCC, and means diagnostics will still match the `file:line:col: error: ` pattern used by some IDE tools. Before: ```console fail_builtins.carbon:11:11: error(AliasRequiresNameRef): alias initializer must be a name reference ``` After: ```console fail_builtins.carbon:11:11: error: alias initializer must be a name reference [AliasRequiresNameRef] ``` Also tighten up test regex to only match on `STDERR` lines that list a file name.
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_bad_condition.carbon
|
||||
|
||||
fn While() {
|
||||
// CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `String` to `bool`
|
||||
// CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `String` to `bool` [ImplicitAsConversionFailure]
|
||||
// CHECK:STDERR: while ("Hello") {}
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs`
|
||||
// CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note: type `String` does not implement interface `ImplicitAs` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: while ("Hello") {}
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
while ("Hello") {}
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_break_continue.carbon
|
||||
|
||||
fn While() {
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error(ContinueOutsideLoop): `continue` can only be used in a loop
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `continue` can only be used in a loop [ContinueOutsideLoop]
|
||||
// CHECK:STDERR: continue;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
continue;
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error(BreakOutsideLoop): `break` can only be used in a loop
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `break` can only be used in a loop [BreakOutsideLoop]
|
||||
// CHECK:STDERR: break;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -23,12 +23,12 @@ fn While() {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error(ContinueOutsideLoop): `continue` can only be used in a loop
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `continue` can only be used in a loop [ContinueOutsideLoop]
|
||||
// CHECK:STDERR: continue;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
continue;
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: error(BreakOutsideLoop): `break` can only be used in a loop
|
||||
// CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: error: `break` can only be used in a loop [BreakOutsideLoop]
|
||||
// CHECK:STDERR: break;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user