Selaa lähdekoodia

Add "ERROR" to all error diagnostics (#3251)

This makes the difference between errors and lower-level diagnostics
visible to users, and aligns the toolchain's behavior with the
expectations in `driver_fuzzer.cpp`.
Geoff Romer 2 vuotta sitten
vanhempi
sitoutus
7899154a21
100 muutettua tiedostoa jossa 164 lisäystä ja 159 poistoa
  1. 1 1
      toolchain/check/testdata/array/fail_bound_overflow.carbon
  2. 1 1
      toolchain/check/testdata/array/fail_invalid_type.carbon
  3. 1 1
      toolchain/check/testdata/array/fail_out_of_bound.carbon
  4. 4 4
      toolchain/check/testdata/array/fail_type_mismatch.carbon
  5. 1 1
      toolchain/check/testdata/array/fail_undefined_bound.carbon
  6. 1 1
      toolchain/check/testdata/basics/fail_name_lookup.carbon
  7. 1 1
      toolchain/check/testdata/basics/fail_non_type_as_type.carbon
  8. 1 1
      toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon
  9. 1 1
      toolchain/check/testdata/const/fail_collapse.carbon
  10. 2 2
      toolchain/check/testdata/function/call/fail_not_callable.carbon
  11. 6 6
      toolchain/check/testdata/function/call/fail_param_count.carbon
  12. 1 1
      toolchain/check/testdata/function/call/fail_param_type.carbon
  13. 1 1
      toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon
  14. 1 1
      toolchain/check/testdata/function/definition/fail_param_name_conflict.carbon
  15. 3 3
      toolchain/check/testdata/if/fail_reachable_fallthrough.carbon
  16. 1 1
      toolchain/check/testdata/if/fail_scope.carbon
  17. 1 1
      toolchain/check/testdata/index/fail_array_large_index.carbon
  18. 1 1
      toolchain/check/testdata/index/fail_array_non_int_indexing.carbon
  19. 1 1
      toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon
  20. 1 1
      toolchain/check/testdata/index/fail_empty_tuple_access.carbon
  21. 4 4
      toolchain/check/testdata/index/fail_invalid_base.carbon
  22. 1 1
      toolchain/check/testdata/index/fail_name_not_found.carbon
  23. 1 1
      toolchain/check/testdata/index/fail_negative_indexing.carbon
  24. 1 1
      toolchain/check/testdata/index/fail_non_deterministic_type.carbon
  25. 1 1
      toolchain/check/testdata/index/fail_non_tuple_access.carbon
  26. 1 1
      toolchain/check/testdata/index/fail_tuple_large_index.carbon
  27. 1 1
      toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon
  28. 1 1
      toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon
  29. 1 1
      toolchain/check/testdata/namespace/fail_duplicate.carbon
  30. 1 1
      toolchain/check/testdata/namespace/fail_unresolved_scope.carbon
  31. 8 8
      toolchain/check/testdata/operators/fail_assigment_to_non_assignable.carbon
  32. 1 1
      toolchain/check/testdata/operators/fail_type_mismatch.carbon
  33. 1 1
      toolchain/check/testdata/operators/fail_type_mismatch_assignment.carbon
  34. 1 1
      toolchain/check/testdata/operators/fail_type_mismatch_once.carbon
  35. 14 14
      toolchain/check/testdata/pointer/fail_address_of_value.carbon
  36. 3 3
      toolchain/check/testdata/pointer/fail_dereference_not_pointer.carbon
  37. 1 1
      toolchain/check/testdata/pointer/fail_dereference_type.carbon
  38. 1 1
      toolchain/check/testdata/pointer/fail_type_mismatch.carbon
  39. 1 1
      toolchain/check/testdata/return/fail_missing_return.carbon
  40. 1 1
      toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon
  41. 1 1
      toolchain/check/testdata/return/fail_type_mismatch.carbon
  42. 1 1
      toolchain/check/testdata/return/fail_value_disallowed.carbon
  43. 1 1
      toolchain/check/testdata/return/fail_value_missing.carbon
  44. 1 1
      toolchain/check/testdata/struct/fail_access_into_invalid.carbon
  45. 1 1
      toolchain/check/testdata/struct/fail_assign_empty.carbon
  46. 1 1
      toolchain/check/testdata/struct/fail_assign_nested.carbon
  47. 1 1
      toolchain/check/testdata/struct/fail_assign_to_empty.carbon
  48. 1 1
      toolchain/check/testdata/struct/fail_field_name_mismatch.carbon
  49. 1 1
      toolchain/check/testdata/struct/fail_field_type_mismatch.carbon
  50. 1 1
      toolchain/check/testdata/struct/fail_member_access_type.carbon
  51. 1 1
      toolchain/check/testdata/struct/fail_non_member_access.carbon
  52. 1 1
      toolchain/check/testdata/struct/fail_too_few_values.carbon
  53. 1 1
      toolchain/check/testdata/struct/fail_type_assign.carbon
  54. 1 1
      toolchain/check/testdata/struct/fail_value_as_type.carbon
  55. 1 1
      toolchain/check/testdata/tuples/fail_assign_empty.carbon
  56. 1 1
      toolchain/check/testdata/tuples/fail_assign_nested.carbon
  57. 1 1
      toolchain/check/testdata/tuples/fail_assign_to_empty.carbon
  58. 1 1
      toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon
  59. 1 1
      toolchain/check/testdata/tuples/fail_too_few_element.carbon
  60. 1 1
      toolchain/check/testdata/tuples/fail_type_assign.carbon
  61. 1 1
      toolchain/check/testdata/tuples/fail_value_as_type.carbon
  62. 1 1
      toolchain/check/testdata/var/fail_duplicate_decl.carbon
  63. 1 1
      toolchain/check/testdata/var/fail_init_type_mismatch.carbon
  64. 1 1
      toolchain/check/testdata/var/fail_init_with_self.carbon
  65. 1 1
      toolchain/check/testdata/var/fail_lookup_outside_scope.carbon
  66. 1 1
      toolchain/check/testdata/var/fail_storage_is_literal.carbon
  67. 8 3
      toolchain/diagnostics/diagnostic_emitter.h
  68. 2 2
      toolchain/driver/testdata/fail_errors_in_two_files.carbon
  69. 2 2
      toolchain/driver/testdata/fail_errors_sorted.carbon
  70. 2 2
      toolchain/driver/testdata/fail_errors_streamed.carbon
  71. 3 3
      toolchain/driver/testdata/fail_flush_errors.carbon
  72. 1 1
      toolchain/driver/testdata/fail_missing_file.carbon
  73. 1 1
      toolchain/lex/testdata/fail_block_string_second_line.carbon
  74. 2 2
      toolchain/lex/testdata/fail_multifile.carbon
  75. 1 1
      toolchain/lower/testdata/basics/fail_before_lowering.carbon
  76. 4 4
      toolchain/parse/testdata/array/fail_require_close_bracket.carbon
  77. 1 1
      toolchain/parse/testdata/array/fail_require_semi.carbon
  78. 3 3
      toolchain/parse/testdata/basics/fail_invalid_designators.carbon
  79. 1 1
      toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon
  80. 1 1
      toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon
  81. 3 3
      toolchain/parse/testdata/basics/fail_paren_match_regression.carbon
  82. 1 1
      toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon
  83. 4 4
      toolchain/parse/testdata/for/fail_missing_cond.carbon
  84. 1 1
      toolchain/parse/testdata/for/fail_missing_in.carbon
  85. 1 1
      toolchain/parse/testdata/for/fail_missing_var.carbon
  86. 4 4
      toolchain/parse/testdata/for/fail_square_brackets.carbon
  87. 1 1
      toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon
  88. 3 3
      toolchain/parse/testdata/function/declaration/fail_missing_deduced_close.carbon
  89. 1 1
      toolchain/parse/testdata/function/declaration/fail_missing_name.carbon
  90. 1 1
      toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon
  91. 1 1
      toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon
  92. 1 1
      toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon
  93. 1 1
      toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon
  94. 1 1
      toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon
  95. 1 1
      toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon
  96. 1 1
      toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon
  97. 1 1
      toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon
  98. 1 1
      toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon
  99. 1 1
      toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon
  100. 1 1
      toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon

+ 1 - 1
toolchain/check/testdata/array/fail_bound_overflow.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:32: Invalid array expression.
+// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:32: ERROR: Invalid array expression.
 // CHECK:STDERR: var a: [1; 39999999999999999993];
 // CHECK:STDERR:                                ^
 var a: [1; 39999999999999999993];

+ 1 - 1
toolchain/check/testdata/array/fail_invalid_type.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:13: Cannot implicitly convert from `i32` to `type`.
+// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:13: ERROR: Cannot implicitly convert from `i32` to `type`.
 // CHECK:STDERR: var a: [1; 1];
 // CHECK:STDERR:             ^
 var a: [1; 1];

+ 1 - 1
toolchain/check/testdata/array/fail_out_of_bound.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:27: Cannot initialize array of 1 element(s) from 3 initializer(s).
+// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:27: ERROR: Cannot initialize array of 1 element(s) from 3 initializer(s).
 // CHECK:STDERR: var a: [i32; 1] = (1, 2, 3);
 // CHECK:STDERR:                           ^
 var a: [i32; 1] = (1, 2, 3);

+ 4 - 4
toolchain/check/testdata/array/fail_type_mismatch.carbon

@@ -4,23 +4,23 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:39: Cannot implicitly convert from `String` to `i32`.
+// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:39: ERROR: Cannot implicitly convert from `String` to `i32`.
 // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World");
 // CHECK:STDERR:                                       ^
 var a: [i32; 3] = (1, "Hello", "World");
 
-// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:5: Cannot implicitly convert from `String` to `i32`.
+// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:5: ERROR: Cannot implicitly convert from `String` to `i32`.
 // CHECK:STDERR: var t1: (i32, String, String);
 // CHECK:STDERR:     ^
 var t1: (i32, String, String);
 var b: [i32; 3] = t1;
 
-// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:24: Cannot initialize array of 3 element(s) from 2 initializer(s).
+// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:24: ERROR: Cannot initialize array of 3 element(s) from 2 initializer(s).
 // CHECK:STDERR: var c: [i32; 3] = (1, 2);
 // CHECK:STDERR:                        ^
 var c: [i32; 3] = (1, 2);
 
-// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:5: Cannot initialize array of 3 element(s) from tuple with 2 element(s).
+// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:5: ERROR: Cannot initialize array of 3 element(s) from tuple with 2 element(s).
 // CHECK:STDERR: var t2: (i32, i32);
 // CHECK:STDERR:     ^
 var t2: (i32, i32);

+ 1 - 1
toolchain/check/testdata/array/fail_undefined_bound.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:14: Semantics TODO: `HandleArrayExpressionWithoutBounds`.
+// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:14: ERROR: Semantics TODO: `HandleArrayExpressionWithoutBounds`.
 // CHECK:STDERR: var a: [i32; ];
 // CHECK:STDERR:              ^
 var a: [i32; ];

+ 1 - 1
toolchain/check/testdata/basics/fail_name_lookup.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: Name `x` not found.
+  // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: ERROR: Name `x` not found.
   // CHECK:STDERR:   x;
   // CHECK:STDERR:   ^
   x;

+ 1 - 1
toolchain/check/testdata/basics/fail_non_type_as_type.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:17: Cannot implicitly convert from `i32` to `type`.
+// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:17: ERROR: Cannot implicitly convert from `i32` to `type`.
 // CHECK:STDERR: var x: type = 42;
 // CHECK:STDERR:                 ^
 var x: type = 42;

+ 1 - 1
toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var x: i32;
-// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:15: Type `i32` does not support qualified expressions.
+// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:15: ERROR: Type `i32` does not support qualified expressions.
 // CHECK:STDERR: var y: i32 = x.b;
 // CHECK:STDERR:               ^
 var y: i32 = x.b;

+ 1 - 1
toolchain/check/testdata/const/fail_collapse.carbon

@@ -8,7 +8,7 @@
 // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** {
 // CHECK:STDERR:         ^
 fn G(p: const (const i32)**) -> i32** {
-  // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:11: Cannot implicitly convert from `const i32**` to `i32**`.
+  // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:11: ERROR: Cannot implicitly convert from `const i32**` to `i32**`.
   // CHECK:STDERR:   return p;
   // CHECK:STDERR:           ^
   return p;

+ 2 - 2
toolchain/check/testdata/function/call/fail_not_callable.carbon

@@ -5,10 +5,10 @@
 // AUTOUPDATE
 
 fn Run() {
-  // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+6]]:24: Semantics TODO: `Not a callable name`.
+  // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+6]]:24: ERROR: Semantics TODO: `Not a callable name`.
   // CHECK:STDERR:   var x: i32 = "hello"();
   // CHECK:STDERR:                        ^
-  // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:25: Cannot implicitly convert from `String` to `i32`.
+  // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:25: ERROR: Cannot implicitly convert from `String` to `i32`.
   // CHECK:STDERR:   var x: i32 = "hello"();
   // CHECK:STDERR:                         ^
   var x: i32 = "hello"();

+ 6 - 6
toolchain/check/testdata/function/call/fail_param_count.carbon

@@ -9,14 +9,14 @@ fn Run1(a: i32) {}
 fn Run2(a: i32, b: i32) {}
 
 fn Main() {
-  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: 1 argument(s) passed to function expecting 0 argument(s).
+  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: ERROR: 1 argument(s) passed to function expecting 0 argument(s).
   // CHECK:STDERR:   Run0(1);
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: Calling function declared here.
   // CHECK:STDERR: fn Run0() {}
   // CHECK:STDERR: ^
   Run0(1);
-  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: 2 argument(s) passed to function expecting 0 argument(s).
+  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: ERROR: 2 argument(s) passed to function expecting 0 argument(s).
   // CHECK:STDERR:   Run0(0, 1);
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_param_count.carbon:[[@LINE-15]]:1: Calling function declared here.
@@ -24,14 +24,14 @@ fn Main() {
   // CHECK:STDERR: ^
   Run0(0, 1);
 
-  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: 0 argument(s) passed to function expecting 1 argument(s).
+  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: ERROR: 0 argument(s) passed to function expecting 1 argument(s).
   // CHECK:STDERR:   Run1();
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_param_count.carbon:[[@LINE-22]]:1: Calling function declared here.
   // CHECK:STDERR: fn Run1(a: i32) {}
   // CHECK:STDERR: ^
   Run1();
-  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: 2 argument(s) passed to function expecting 1 argument(s).
+  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: ERROR: 2 argument(s) passed to function expecting 1 argument(s).
   // CHECK:STDERR:   Run1(0, 1);
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_param_count.carbon:[[@LINE-29]]:1: Calling function declared here.
@@ -39,14 +39,14 @@ fn Main() {
   // CHECK:STDERR: ^
   Run1(0, 1);
 
-  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: 0 argument(s) passed to function expecting 2 argument(s).
+  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: ERROR: 0 argument(s) passed to function expecting 2 argument(s).
   // CHECK:STDERR:   Run2();
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_param_count.carbon:[[@LINE-36]]:1: Calling function declared here.
   // CHECK:STDERR: fn Run2(a: i32, b: i32) {}
   // CHECK:STDERR: ^
   Run2();
-  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: 1 argument(s) passed to function expecting 2 argument(s).
+  // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:7: ERROR: 1 argument(s) passed to function expecting 2 argument(s).
   // CHECK:STDERR:   Run2(0);
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_param_count.carbon:[[@LINE-43]]:1: Calling function declared here.

+ 1 - 1
toolchain/check/testdata/function/call/fail_param_type.carbon

@@ -7,7 +7,7 @@
 fn Run(a: i32) {}
 
 fn Main() {
-  // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:6: Cannot implicitly convert from `f64` to `i32`.
+  // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:6: ERROR: Cannot implicitly convert from `f64` to `i32`.
   // CHECK:STDERR:   Run(1.0);
   // CHECK:STDERR:      ^
   // CHECK:STDERR: fail_param_type.carbon:[[@LINE-6]]:1: Initializing parameter 1 of function declared here.

+ 1 - 1
toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon

@@ -7,7 +7,7 @@
 fn Foo() -> f64 { return 1.0; }
 
 fn Run() {
-  // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:21: Cannot implicitly convert from `f64` to `i32`.
+  // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:21: ERROR: Cannot implicitly convert from `f64` to `i32`.
   // CHECK:STDERR:   var x: i32 = Foo();
   // CHECK:STDERR:                     ^
   var x: i32 = Foo();

+ 1 - 1
toolchain/check/testdata/function/definition/fail_param_name_conflict.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_param_name_conflict.carbon:[[@LINE+6]]:16: Duplicate name being declared in the same scope.
+// CHECK:STDERR: fail_param_name_conflict.carbon:[[@LINE+6]]:16: ERROR: Duplicate name being declared in the same scope.
 // CHECK:STDERR: fn Bar(a: i32, a: i32) {}
 // CHECK:STDERR:                ^
 // CHECK:STDERR: fail_param_name_conflict.carbon:[[@LINE+3]]:8: Name is previously declared here.

+ 3 - 3
toolchain/check/testdata/if/fail_reachable_fallthrough.carbon

@@ -9,7 +9,7 @@ fn If1(b: bool) -> i32 {
     return 1;
   } else {
   }
-// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: Missing `return` at end of function with declared return type.
+// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }
@@ -19,7 +19,7 @@ fn If2(b: bool) -> i32 {
   } else {
     return 2;
   }
-// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: Missing `return` at end of function with declared return type.
+// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }
@@ -28,7 +28,7 @@ fn If3(b: bool) -> i32 {
   if (b) {
     return 1;
   }
-// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: Missing `return` at end of function with declared return type.
+// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }

+ 1 - 1
toolchain/check/testdata/if/fail_scope.carbon

@@ -9,7 +9,7 @@ fn VarScope(b: bool) -> i32 {
     var n: i32 = 2;
     return n;
   }
-  // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: Name `n` not found.
+  // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: ERROR: Name `n` not found.
   // CHECK:STDERR:   return n;
   // CHECK:STDERR:          ^
   return n;

+ 1 - 1
toolchain/check/testdata/index/fail_array_large_index.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var a: [i32; 1] = (12,);
-// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:35: Index `295147905179352825855` is past the end of `[i32; 1]`.
+// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:35: ERROR: Index `295147905179352825855` is past the end of `[i32; 1]`.
 // CHECK:STDERR: var b: i32 = a[0xFFFFFFFFFFFFFFFFF];
 // CHECK:STDERR:                                   ^
 var b: i32 = a[0xFFFFFFFFFFFFFFFFF];

+ 1 - 1
toolchain/check/testdata/index/fail_array_non_int_indexing.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var a: [i32; 1] = (12,);
-// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: Cannot implicitly convert from `f64` to `i32`.
+// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: ERROR: Cannot implicitly convert from `f64` to `i32`.
 // CHECK:STDERR: var b: i32 = a[2.6];
 // CHECK:STDERR:                ^
 var b: i32 = a[2.6];

+ 1 - 1
toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var a: [i32; 1] = (12,);
-// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:17: Index `2` is past the end of `[i32; 1]`.
+// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:17: ERROR: Index `2` is past the end of `[i32; 1]`.
 // CHECK:STDERR: var b: i32 = a[2];
 // CHECK:STDERR:                 ^
 var b: i32 = a[2];

+ 1 - 1
toolchain/check/testdata/index/fail_empty_tuple_access.carbon

@@ -7,7 +7,7 @@
 fn F() {}
 
 fn Run() {
-  // CHECK:STDERR: fail_empty_tuple_access.carbon:[[@LINE+3]]:8: Index `0` is past the end of `() as type`.
+  // CHECK:STDERR: fail_empty_tuple_access.carbon:[[@LINE+3]]:8: ERROR: Index `0` is past the end of `() as type`.
   // CHECK:STDERR:   F()[0];
   // CHECK:STDERR:        ^
   F()[0];

+ 4 - 4
toolchain/check/testdata/index/fail_invalid_base.carbon

@@ -8,24 +8,24 @@
 // representation for a reference to a name so that we can track the location
 // properly.
 
-// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:12: Expression cannot be used as a value.
+// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:12: ERROR: Expression cannot be used as a value.
 // CHECK:STDERR: namespace N;
 // CHECK:STDERR:            ^
 namespace N;
 var a: i32 = N[0];
 
-// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:1: Expression cannot be used as a value.
+// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:1: ERROR: Expression cannot be used as a value.
 // CHECK:STDERR: fn F();
 // CHECK:STDERR: ^
 fn F();
 var b: i32 = F[1];
 
-// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:32: `{.a: i32, .b: i32}` does not support indexing.
+// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:32: ERROR: `{.a: i32, .b: i32}` does not support indexing.
 // CHECK:STDERR: var c: i32 = {.a = 1, .b = 2}[0];
 // CHECK:STDERR:                                ^
 var c: i32 = {.a = 1, .b = 2}[0];
 
-// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:34: `type` does not support indexing.
+// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:34: ERROR: `type` does not support indexing.
 // CHECK:STDERR: var d: i32 = {.a: i32, .b: i32}[0];
 // CHECK:STDERR:                                  ^
 var d: i32 = {.a: i32, .b: i32}[0];

+ 1 - 1
toolchain/check/testdata/index/fail_name_not_found.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: Name `a` not found.
+  // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: ERROR: Name `a` not found.
   // CHECK:STDERR:   var b: i32 = a[0];
   // CHECK:STDERR:                ^
   var b: i32 = a[0];

+ 1 - 1
toolchain/check/testdata/index/fail_negative_indexing.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var a: (i32, i32) = (12, 6);
-// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: Semantics TODO: `Handle -`.
+// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: ERROR: Semantics TODO: `Handle -`.
 // CHECK:STDERR: var b: i32 = a[-10];
 // CHECK:STDERR:                ^
 var b: i32 = a[-10];

+ 1 - 1
toolchain/check/testdata/index/fail_non_deterministic_type.carbon

@@ -6,7 +6,7 @@
 
 var a: (i32, i32) = (2, 3);
 var b: i32 = 0;
-// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:17: Tuples indices must be integer literals.
+// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:17: ERROR: Tuples indices must be integer literals.
 // CHECK:STDERR: var c: i32 = a[b];
 // CHECK:STDERR:                 ^
 var c: i32 = a[b];

+ 1 - 1
toolchain/check/testdata/index/fail_non_tuple_access.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:6: `i32` does not support indexing.
+  // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:6: ERROR: `i32` does not support indexing.
   // CHECK:STDERR:   0[1];
   // CHECK:STDERR:      ^
   0[1];

+ 1 - 1
toolchain/check/testdata/index/fail_tuple_large_index.carbon

@@ -6,7 +6,7 @@
 
 var a: (i32,) = (12,);
 var b: (i32,) = a;
-// CHECK:STDERR: fail_tuple_large_index.carbon:[[@LINE+3]]:35: Index `295147905179352825855` is past the end of `(i32,) as type`.
+// CHECK:STDERR: fail_tuple_large_index.carbon:[[@LINE+3]]:35: ERROR: Index `295147905179352825855` is past the end of `(i32,) as type`.
 // CHECK:STDERR: var c: i32 = b[0xFFFFFFFFFFFFFFFFF];
 // CHECK:STDERR:                                   ^
 var c: i32 = b[0xFFFFFFFFFFFFFFFFF];

+ 1 - 1
toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var a: (i32, i32) = (12, 6);
-// CHECK:STDERR: fail_tuple_non_int_indexing.carbon:[[@LINE+3]]:19: Tuples indices must be integer literals.
+// CHECK:STDERR: fail_tuple_non_int_indexing.carbon:[[@LINE+3]]:19: ERROR: Tuples indices must be integer literals.
 // CHECK:STDERR: var b: i32 = a[2.6];
 // CHECK:STDERR:                   ^
 var b: i32 = a[2.6];

+ 1 - 1
toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var a: (i32, i32) = (12, 6);
-// CHECK:STDERR: fail_tuple_out_of_bound_access.carbon:[[@LINE+3]]:17: Index `2` is past the end of `(i32, i32) as type`.
+// CHECK:STDERR: fail_tuple_out_of_bound_access.carbon:[[@LINE+3]]:17: ERROR: Index `2` is past the end of `(i32, i32) as type`.
 // CHECK:STDERR: var b: i32 = a[2];
 // CHECK:STDERR:                 ^
 var b: i32 = a[2];

+ 1 - 1
toolchain/check/testdata/namespace/fail_duplicate.carbon

@@ -9,7 +9,7 @@ namespace Foo;
 fn Foo.Baz() {
 }
 
-// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:8: Duplicate name being declared in the same scope.
+// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:8: ERROR: Duplicate name being declared in the same scope.
 // CHECK:STDERR: fn Foo.Baz() {
 // CHECK:STDERR:        ^
 // CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: Name is previously declared here.

+ 1 - 1
toolchain/check/testdata/namespace/fail_unresolved_scope.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: Name `Foo` not found.
+// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: ERROR: Name `Foo` not found.
 // CHECK:STDERR: fn Foo.Baz() {
 // CHECK:STDERR:    ^
 fn Foo.Baz() {

+ 8 - 8
toolchain/check/testdata/operators/fail_assigment_to_non_assignable.carbon

@@ -7,39 +7,39 @@
 fn F() -> i32;
 
 fn Main() {
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:3: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:3: ERROR: Expression is not assignable.
   // CHECK:STDERR:   1 = 2;
   // CHECK:STDERR:   ^
   1 = 2;
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:5: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:5: ERROR: Expression is not assignable.
   // CHECK:STDERR:   F() = 1;
   // CHECK:STDERR:     ^
   F() = 1;
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:8: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:8: ERROR: Expression is not assignable.
   // CHECK:STDERR:   (1, 2) = (3, 4);
   // CHECK:STDERR:        ^
   (1, 2) = (3, 4);
   var n: i32 = 0;
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:8: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:8: ERROR: Expression is not assignable.
   // CHECK:STDERR:   (n, n) = (1, 2);
   // CHECK:STDERR:        ^
   (n, n) = (1, 2);
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:3: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:3: ERROR: Expression is not assignable.
   // CHECK:STDERR:   i32 = i32*;
   // CHECK:STDERR:   ^
   i32 = i32*;
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:18: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:18: ERROR: Expression is not assignable.
   // CHECK:STDERR:   {.x = 1, .y = 2} = {.x = 3, .y = 4};
   // CHECK:STDERR:                  ^
   {.x = 1, .y = 2} = {.x = 3, .y = 4};
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:25: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:25: ERROR: Expression is not assignable.
   // CHECK:STDERR:   (if true then 1 else 2) = 3;
   // CHECK:STDERR:                         ^
   (if true then 1 else 2) = 3;
 
   // Under #911, if expressions are never reference expressions.
   var a: i32;
-  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:25: Expression is not assignable.
+  // CHECK:STDERR: fail_assigment_to_non_assignable.carbon:[[@LINE+3]]:25: ERROR: Expression is not assignable.
   // CHECK:STDERR:   (if true then a else a) = 10;
   // CHECK:STDERR:                         ^
   (if true then a else a) = 10;

+ 1 - 1
toolchain/check/testdata/operators/fail_type_mismatch.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() -> i32 {
-  // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:13: Cannot implicitly convert from `i32` to `f64`.
+  // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:13: ERROR: Cannot implicitly convert from `i32` to `f64`.
   // CHECK:STDERR:   return 12 + 3.4;
   // CHECK:STDERR:             ^
   return 12 + 3.4;

+ 1 - 1
toolchain/check/testdata/operators/fail_type_mismatch_assignment.carbon

@@ -6,7 +6,7 @@
 
 fn Main() {
   var a: i32 = 3;
-  // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:5: Cannot implicitly convert from `f64` to `i32`.
+  // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:5: ERROR: Cannot implicitly convert from `f64` to `i32`.
   // CHECK:STDERR:   a = 5.6;
   // CHECK:STDERR:     ^
   a = 5.6;

+ 1 - 1
toolchain/check/testdata/operators/fail_type_mismatch_once.carbon

@@ -7,7 +7,7 @@
 fn Main() -> i32 {
   // The following line has two mismatches, but after the first, it shouldn't
   // keep erroring.
-  // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:13: Cannot implicitly convert from `i32` to `f64`.
+  // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:13: ERROR: Cannot implicitly convert from `i32` to `f64`.
   // CHECK:STDERR:   return 12 + 3.4 + 12;
   // CHECK:STDERR:             ^
   return 12 + 3.4 + 12;

+ 14 - 14
toolchain/check/testdata/pointer/fail_address_of_value.carbon

@@ -9,74 +9,74 @@ fn G() -> i32;
 fn H() -> {.a: i32};
 
 fn AddressOfLiteral() {
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &0;
   // CHECK:STDERR:   ^
   &0;
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &true;
   // CHECK:STDERR:   ^
   &true;
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &1.0;
   // CHECK:STDERR:   ^
   &1.0;
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &"Hello";
   // CHECK:STDERR:   ^
   &"Hello";
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &(1, 2);
   // CHECK:STDERR:   ^
   &(1, 2);
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &{.a = 5};
   // CHECK:STDERR:   ^
   &{.a = 5};
 }
 
 fn AddressOfOperator() {
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &(1 + 1);
   // CHECK:STDERR:   ^
   &(1 + 1);
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of a temporary object.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of a temporary object.
   // CHECK:STDERR:   &H().a;
   // CHECK:STDERR:   ^
   &H().a;
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &(not true);
   // CHECK:STDERR:   ^
   &(not true);
 }
 
 fn AddressOfCall() {
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &G();
   // CHECK:STDERR:   ^
   &G();
 }
 
 fn AddressOfType() {
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &i32;
   // CHECK:STDERR:   ^
   &i32;
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &(const i32*);
   // CHECK:STDERR:   ^
   &(const i32*);
 }
 
 fn AddressOfTupleElementValue() {
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:3: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   &((1, 2)[0]);
   // CHECK:STDERR:   ^
   &((1, 2)[0]);
 }
 
 fn AddressOfParameter(param: i32) {
-  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: Cannot take the address of non-reference expression.
+  // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: ERROR: Cannot take the address of non-reference expression.
   // CHECK:STDERR:   var param_addr: i32* = &param;
   // CHECK:STDERR:                          ^
   var param_addr: i32* = &param;

+ 3 - 3
toolchain/check/testdata/pointer/fail_dereference_not_pointer.carbon

@@ -5,15 +5,15 @@
 // AUTOUPDATE
 
 fn Deref(n: i32) {
-  // CHECK:STDERR: fail_dereference_not_pointer.carbon:[[@LINE+3]]:3: Cannot dereference operand of non-pointer type `i32`.
+  // CHECK:STDERR: fail_dereference_not_pointer.carbon:[[@LINE+3]]:3: ERROR: Cannot dereference operand of non-pointer type `i32`.
   // CHECK:STDERR:   *n;
   // CHECK:STDERR:   ^
   *n;
-  // CHECK:STDERR: fail_dereference_not_pointer.carbon:[[@LINE+3]]:3: Cannot dereference operand of non-pointer type `() as type`.
+  // CHECK:STDERR: fail_dereference_not_pointer.carbon:[[@LINE+3]]:3: ERROR: Cannot dereference operand of non-pointer type `() as type`.
   // CHECK:STDERR:   *();
   // CHECK:STDERR:   ^
   *();
-  // CHECK:STDERR: fail_dereference_not_pointer.carbon:[[@LINE+3]]:3: Cannot dereference operand of non-pointer type `{} as type`.
+  // CHECK:STDERR: fail_dereference_not_pointer.carbon:[[@LINE+3]]:3: ERROR: Cannot dereference operand of non-pointer type `{} as type`.
   // CHECK:STDERR:   *{};
   // CHECK:STDERR:   ^
   *{};

+ 1 - 1
toolchain/check/testdata/pointer/fail_dereference_type.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_dereference_type.carbon:[[@LINE+6]]:8: Cannot dereference operand of non-pointer type `type`.
+// CHECK:STDERR: fail_dereference_type.carbon:[[@LINE+6]]:8: ERROR: Cannot dereference operand of non-pointer type `type`.
 // CHECK:STDERR: var p: *i32;
 // CHECK:STDERR:        ^
 // CHECK:STDERR: fail_dereference_type.carbon:[[@LINE+3]]:8: To form a pointer type, write the `*` after the pointee type.

+ 1 - 1
toolchain/check/testdata/pointer/fail_type_mismatch.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn ConstMismatch(p: const {}*) -> const ({}*) {
-  // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:11: Cannot implicitly convert from `const {}*` to `const ({}*)`.
+  // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:11: ERROR: Cannot implicitly convert from `const {}*` to `const ({}*)`.
   // CHECK:STDERR:   return p;
   // CHECK:STDERR:           ^
   return p;

+ 1 - 1
toolchain/check/testdata/return/fail_missing_return.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() -> i32 {
-// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: Missing `return` at end of function with declared return type.
+// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }

+ 1 - 1
toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn F() -> () {
-// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: Missing `return` at end of function with declared return type.
+// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: ERROR: Missing `return` at end of function with declared return type.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }

+ 1 - 1
toolchain/check/testdata/return/fail_type_mismatch.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() -> i32 {
-  // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:13: Cannot implicitly convert from `f64` to `i32`.
+  // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:13: ERROR: Cannot implicitly convert from `f64` to `i32`.
   // CHECK:STDERR:   return 1.0;
   // CHECK:STDERR:             ^
   return 1.0;

+ 1 - 1
toolchain/check/testdata/return/fail_value_disallowed.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:11: No return expression should be provided in this context.
+  // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:11: ERROR: No return expression should be provided in this context.
   // CHECK:STDERR:   return 0;
   // CHECK:STDERR:           ^
   // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: There was no return type provided.

+ 1 - 1
toolchain/check/testdata/return/fail_value_missing.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() -> i32 {
-  // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+3]]:9: Must return a i32.
+  // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+3]]:9: ERROR: Must return a i32.
   // CHECK:STDERR:   return;
   // CHECK:STDERR:         ^
   return;

+ 1 - 1
toolchain/check/testdata/struct/fail_access_into_invalid.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 
-// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: Name `a` not found.
+// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: ERROR: Name `a` not found.
 // CHECK:STDERR: fn F() { a.b; }
 // CHECK:STDERR:          ^
 fn F() { a.b; }

+ 1 - 1
toolchain/check/testdata/struct/fail_assign_empty.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:22: Cannot implicitly convert from `{} as type` to `{.a: i32}`.
+// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:22: ERROR: Cannot implicitly convert from `{} as type` to `{.a: i32}`.
 // CHECK:STDERR: var x: {.a: i32} = {};
 // CHECK:STDERR:                      ^
 var x: {.a: i32} = {};

+ 1 - 1
toolchain/check/testdata/struct/fail_assign_nested.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:28: Cannot implicitly convert from `{.b: {}}` to `{.a: {}}`.
+// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:28: ERROR: Cannot implicitly convert from `{.b: {}}` to `{.a: {}}`.
 // CHECK:STDERR: var x: {.a: {}} = {.b = {}};
 // CHECK:STDERR:                            ^
 var x: {.a: {}} = {.b = {}};

+ 1 - 1
toolchain/check/testdata/struct/fail_assign_to_empty.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:21: Cannot implicitly convert from `{.a: i32}` to `{} as type`.
+// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:21: ERROR: Cannot implicitly convert from `{.a: i32}` to `{} as type`.
 // CHECK:STDERR: var x: {} = {.a = 1};
 // CHECK:STDERR:                     ^
 var x: {} = {.a = 1};

+ 1 - 1
toolchain/check/testdata/struct/fail_field_name_mismatch.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:28: Cannot implicitly convert from `{.b: i32}` to `{.a: i32}`.
+// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:28: ERROR: Cannot implicitly convert from `{.b: i32}` to `{.a: i32}`.
 // CHECK:STDERR: var x: {.a: i32} = {.b = 1};
 // CHECK:STDERR:                            ^
 var x: {.a: i32} = {.b = 1};

+ 1 - 1
toolchain/check/testdata/struct/fail_field_type_mismatch.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:30: Cannot implicitly convert from `{.b: f64}` to `{.a: i32}`.
+// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:30: ERROR: Cannot implicitly convert from `{.b: f64}` to `{.a: i32}`.
 // CHECK:STDERR: var x: {.a: i32} = {.b = 1.0};
 // CHECK:STDERR:                              ^
 var x: {.a: i32} = {.b = 1.0};

+ 1 - 1
toolchain/check/testdata/struct/fail_member_access_type.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var x: {.a: f64} = {.a = 4.0};
-// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:15: Type `{.a: f64}` does not have a member `b`.
+// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:15: ERROR: Type `{.a: f64}` does not have a member `b`.
 // CHECK:STDERR: var y: i32 = x.b;
 // CHECK:STDERR:               ^
 var y: i32 = x.b;

+ 1 - 1
toolchain/check/testdata/struct/fail_non_member_access.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 var x: {.a: i32} = {.a = 4};
-// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:15: Type `{.a: i32}` does not have a member `b`.
+// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:15: ERROR: Type `{.a: i32}` does not have a member `b`.
 // CHECK:STDERR: var y: i32 = x.b;
 // CHECK:STDERR:               ^
 var y: i32 = x.b;

+ 1 - 1
toolchain/check/testdata/struct/fail_too_few_values.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:37: Cannot implicitly convert from `{.a: i32}` to `{.a: i32, .b: i32}`.
+// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:37: ERROR: Cannot implicitly convert from `{.a: i32}` to `{.a: i32, .b: i32}`.
 // CHECK:STDERR: var x: {.a: i32, .b: i32} = {.a = 1};
 // CHECK:STDERR:                                     ^
 var x: {.a: i32, .b: i32} = {.a = 1};

+ 1 - 1
toolchain/check/testdata/struct/fail_type_assign.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:29: Cannot implicitly convert from `type` to `{.a: i32}`.
+// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:29: ERROR: Cannot implicitly convert from `type` to `{.a: i32}`.
 // CHECK:STDERR: var x: {.a: i32} = {.a: i32};
 // CHECK:STDERR:                             ^
 var x: {.a: i32} = {.a: i32};

+ 1 - 1
toolchain/check/testdata/struct/fail_value_as_type.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:15: Cannot implicitly convert from `{.a: i32}` to `type`.
+// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:15: ERROR: Cannot implicitly convert from `{.a: i32}` to `type`.
 // CHECK:STDERR: var x: {.a = 1};
 // CHECK:STDERR:               ^
 var x: {.a = 1};

+ 1 - 1
toolchain/check/testdata/tuples/fail_assign_empty.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:19: Cannot implicitly convert from `() as type` to `(i32,) as type`.
+// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:19: ERROR: Cannot implicitly convert from `() as type` to `(i32,) as type`.
 // CHECK:STDERR: var x: (i32,) = ();
 // CHECK:STDERR:                   ^
 var x: (i32,) = ();

+ 1 - 1
toolchain/check/testdata/tuples/fail_assign_nested.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:57: Cannot implicitly convert from `((i32, i32, i32), (i32, i32, i32)) as type` to `((i32, i32), (i32, i32)) as type`.
+// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:57: ERROR: Cannot implicitly convert from `((i32, i32, i32), (i32, i32, i32)) as type` to `((i32, i32), (i32, i32)) as type`.
 // CHECK:STDERR: var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6));
 // CHECK:STDERR:                                                         ^
 var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6));

+ 1 - 1
toolchain/check/testdata/tuples/fail_assign_to_empty.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:17: Cannot implicitly convert from `i32` to `() as type`.
+// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:17: ERROR: Cannot implicitly convert from `i32` to `() as type`.
 // CHECK:STDERR: var x: () = (66);
 // CHECK:STDERR:                 ^
 var x: () = (66);

+ 1 - 1
toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:31: Cannot implicitly convert from `(i32, f64) as type` to `(i32, i32) as type`.
+// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:31: ERROR: Cannot implicitly convert from `(i32, f64) as type` to `(i32, i32) as type`.
 // CHECK:STDERR: var x: (i32, i32) = (2, 65.89);
 // CHECK:STDERR:                               ^
 var x: (i32, i32) = (2, 65.89);

+ 1 - 1
toolchain/check/testdata/tuples/fail_too_few_element.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+3]]:26: Cannot implicitly convert from `(i32,) as type` to `(i32, i32) as type`.
+// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+3]]:26: ERROR: Cannot implicitly convert from `(i32,) as type` to `(i32, i32) as type`.
 // CHECK:STDERR: var x: (i32, i32) = (2, );
 // CHECK:STDERR:                          ^
 var x: (i32, i32) = (2, );

+ 1 - 1
toolchain/check/testdata/tuples/fail_type_assign.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:25: Cannot implicitly convert from `(type,) as type` to `(i32,) as type`.
+// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:25: ERROR: Cannot implicitly convert from `(type,) as type` to `(i32,) as type`.
 // CHECK:STDERR: var x: (i32, ) = (i32, );
 // CHECK:STDERR:                         ^
 var x: (i32, ) = (i32, );

+ 1 - 1
toolchain/check/testdata/tuples/fail_value_as_type.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:12: Cannot implicitly convert from `i32` to `type`.
+// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:12: ERROR: Cannot implicitly convert from `i32` to `type`.
 // CHECK:STDERR: var x: (1, );
 // CHECK:STDERR:            ^
 var x: (1, );

+ 1 - 1
toolchain/check/testdata/var/fail_duplicate_decl.carbon

@@ -7,7 +7,7 @@
 
 fn Main() {
   var x: i32 = 0;
-  // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: Duplicate name being declared in the same scope.
+  // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: ERROR: Duplicate name being declared in the same scope.
   // CHECK:STDERR:   var x: i32 = 0;
   // CHECK:STDERR:       ^
   // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: Name is previously declared here.

+ 1 - 1
toolchain/check/testdata/var/fail_init_type_mismatch.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:19: Cannot implicitly convert from `f64` to `i32`.
+  // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:19: ERROR: Cannot implicitly convert from `f64` to `i32`.
   // CHECK:STDERR:   var x: i32 = 1.0;
   // CHECK:STDERR:                   ^
   var x: i32 = 1.0;

+ 1 - 1
toolchain/check/testdata/var/fail_init_with_self.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:16: Name `x` not found.
+  // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:16: ERROR: Name `x` not found.
   // CHECK:STDERR:   var x: i32 = x;
   // CHECK:STDERR:                ^
   var x: i32 = x;

+ 1 - 1
toolchain/check/testdata/var/fail_lookup_outside_scope.carbon

@@ -8,7 +8,7 @@ fn Main() {
   var x: i32;
 }
 
-// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:14: Name `x` not found.
+// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:14: ERROR: Name `x` not found.
 // CHECK:STDERR: var y: i32 = x;
 // CHECK:STDERR:              ^
 var y: i32 = x;

+ 1 - 1
toolchain/check/testdata/var/fail_storage_is_literal.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn Main() {
-  // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: Cannot implicitly convert from `i32` to `type`.
+  // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: ERROR: Cannot implicitly convert from `i32` to `type`.
   // CHECK:STDERR:   var x: 1 = 1;
   // CHECK:STDERR:          ^
   var x: 1 = 1;

+ 8 - 3
toolchain/diagnostics/diagnostic_emitter.h

@@ -345,12 +345,17 @@ class StreamDiagnosticConsumer : public DiagnosticConsumer {
       : stream_(&stream) {}
 
   auto HandleDiagnostic(Diagnostic diagnostic) -> void override {
-    Print(diagnostic.message);
+    std::string prefix = "";
+    if (diagnostic.level == DiagnosticLevel::Error) {
+      prefix = "ERROR: ";
+    }
+    Print(diagnostic.message, prefix);
     for (const auto& note : diagnostic.notes) {
       Print(note);
     }
   }
-  auto Print(const DiagnosticMessage& message) -> void {
+  auto Print(const DiagnosticMessage& message, llvm::StringRef prefix = "")
+      -> void {
     *stream_ << message.location.file_name;
     if (message.location.line_number > 0) {
       *stream_ << ":" << message.location.line_number;
@@ -358,7 +363,7 @@ class StreamDiagnosticConsumer : public DiagnosticConsumer {
         *stream_ << ":" << message.location.column_number;
       }
     }
-    *stream_ << ": " << message.format_fn(message) << "\n";
+    *stream_ << ": " << prefix << message.format_fn(message) << "\n";
     if (message.location.column_number > 0) {
       *stream_ << message.location.line << "\n";
       stream_->indent(message.location.column_number - 1);

+ 2 - 2
toolchain/driver/testdata/fail_errors_in_two_files.carbon

@@ -8,7 +8,7 @@
 
 // --- file1.carbon
 
-// CHECK:STDERR: file1.carbon:[[@LINE+3]]:24: Closing symbol does not match most recent opening symbol.
+// CHECK:STDERR: file1.carbon:[[@LINE+3]]:24: ERROR: Closing symbol does not match most recent opening symbol.
 // CHECK:STDERR: fn run(String program) {
 // CHECK:STDERR:                        ^
 fn run(String program) {
@@ -16,7 +16,7 @@ fn run(String program) {
 
 // --- file2.carbon
 
-// CHECK:STDERR: file2.carbon:[[@LINE+3]]:10: Invalid digit 'a' in decimal numeric literal.
+// CHECK:STDERR: file2.carbon:[[@LINE+3]]:10: ERROR: Invalid digit 'a' in decimal numeric literal.
 // CHECK:STDERR: var x = 3a;
 // CHECK:STDERR:          ^
 var x = 3a;

+ 2 - 2
toolchain/driver/testdata/fail_errors_sorted.carbon

@@ -6,13 +6,13 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:24: Closing symbol does not match most recent opening symbol.
+// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:24: ERROR: Closing symbol does not match most recent opening symbol.
 // CHECK:STDERR: fn run(String program) {
 // CHECK:STDERR:                        ^
 fn run(String program) {
   return True;
 
-// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:10: Invalid digit 'a' in decimal numeric literal.
+// CHECK:STDERR: fail_errors_sorted.carbon:[[@LINE+3]]:10: ERROR: Invalid digit 'a' in decimal numeric literal.
 // CHECK:STDERR: var x = 3a;
 // CHECK:STDERR:          ^
 var x = 3a;

+ 2 - 2
toolchain/driver/testdata/fail_errors_streamed.carbon

@@ -9,10 +9,10 @@
 fn run(String program) {
   return True;
 
-// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE+6]]:10: Invalid digit 'a' in decimal numeric literal.
+// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE+6]]:10: ERROR: Invalid digit 'a' in decimal numeric literal.
 // CHECK:STDERR: var x = 3a;
 // CHECK:STDERR:          ^
-// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE-6]]:24: Closing symbol does not match most recent opening symbol.
+// CHECK:STDERR: fail_errors_streamed.carbon:[[@LINE-6]]:24: ERROR: Closing symbol does not match most recent opening symbol.
 // CHECK:STDERR: fn run(String program) {
 // CHECK:STDERR:                        ^
 var x = 3a;

+ 3 - 3
toolchain/driver/testdata/fail_flush_errors.carbon

@@ -9,7 +9,7 @@
 fn F() {
   // Create diagnostics containing string references, and trigger reallocation
   // of the string table.
-  // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: Name `undeclared1` not found.
+  // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: ERROR: Name `undeclared1` not found.
   // CHECK:STDERR:   undeclared1;
   // CHECK:STDERR:   ^
   undeclared1;
@@ -18,14 +18,14 @@ fn F() {
   // literal storage. Use a hex escape to ensure that the tokenized buffer
   // allocates separate storage for the result.
   "undec\x6Cared2";
-  // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: Name `undeclared2` not found.
+  // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: ERROR: Name `undeclared2` not found.
   // CHECK:STDERR:   undeclared2;
   // CHECK:STDERR:   ^
   undeclared2;
 
   // Add the name into the string table via a declaration rather than an expression.
   if (true) { var undeclared3: i32 = 0; }
-  // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: Name `undeclared3` not found.
+  // CHECK:STDERR: fail_flush_errors.carbon:[[@LINE+3]]:3: ERROR: Name `undeclared3` not found.
   // CHECK:STDERR:   undeclared3;
   // CHECK:STDERR:   ^
   undeclared3;

+ 1 - 1
toolchain/driver/testdata/fail_missing_file.carbon

@@ -5,4 +5,4 @@
 // ARGS: compile nonexistent.carbon
 //
 // AUTOUPDATE
-// CHECK:STDERR: nonexistent.carbon: Error opening file for read: No such file or directory
+// CHECK:STDERR: nonexistent.carbon: ERROR: Error opening file for read: No such file or directory

+ 1 - 1
toolchain/lex/testdata/fail_block_string_second_line.carbon

@@ -7,7 +7,7 @@
 // CHECK:STDOUT: - filename: fail_block_string_second_line.carbon
 // CHECK:STDOUT:   tokens: [
 
-// CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE+4]]:3: Only whitespace is permitted before the closing `'''` of a multi-line string.
+// CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE+4]]:3: ERROR: Only whitespace is permitted before the closing `'''` of a multi-line string.
 // CHECK:STDERR:   error here: '''
 // CHECK:STDERR:   ^
 var s: String = '''

+ 2 - 2
toolchain/lex/testdata/fail_multifile.carbon

@@ -7,7 +7,7 @@
 // --- a.carbon
 // CHECK:STDOUT: - filename: a.carbon
 // CHECK:STDOUT:   tokens: [
-// CHECK:STDERR: a.carbon:[[@LINE+3]]:3: Empty digit sequence in numeric literal.
+// CHECK:STDERR: a.carbon:[[@LINE+3]]:3: ERROR: Empty digit sequence in numeric literal.
 // CHECK:STDERR: 1.a
 // CHECK:STDERR:   ^
 1.a
@@ -18,7 +18,7 @@
 // --- b.carbon
 // CHECK:STDOUT: - filename: b.carbon
 // CHECK:STDOUT:   tokens: [
-// CHECK:STDERR: b.carbon:[[@LINE+3]]:3: Empty digit sequence in numeric literal.
+// CHECK:STDERR: b.carbon:[[@LINE+3]]:3: ERROR: Empty digit sequence in numeric literal.
 // CHECK:STDERR: 2.b
 // CHECK:STDERR:   ^
 2.b

+ 1 - 1
toolchain/lower/testdata/basics/fail_before_lowering.carbon

@@ -5,7 +5,7 @@
 // This validates that earlier errors prevent lowering, without crashing.
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
 // CHECK:STDERR: a;
 // CHECK:STDERR: ^
 a;

+ 4 - 4
toolchain/parse/testdata/array/fail_require_close_bracket.carbon

@@ -5,18 +5,18 @@
 // AUTOUPDATE
 // TODO: It should emit only one error message.
 
-// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+9]]:8: Closing symbol does not match most recent opening symbol.
+// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+9]]:8: ERROR: Closing symbol does not match most recent opening symbol.
 // CHECK:STDERR: var x: [i32;;
 // CHECK:STDERR:        ^
-// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+6]]:13: Expected expression.
+// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+6]]:13: ERROR: Expected expression.
 // CHECK:STDERR: var x: [i32;;
 // CHECK:STDERR:             ^
-// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:13: Unexpected tokens before `]`.
+// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:13: ERROR: Unexpected tokens before `]`.
 // CHECK:STDERR: var x: [i32;;
 // CHECK:STDERR:             ^
 var x: [i32;;
 
-// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+15]]:21: `var` declarations must end with a `;`.
+// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+15]]:21: ERROR: `var` declarations must end with a `;`.
 // CHECK:STDERR: // CHECK:STDOUT:   ]
 // CHECK:STDERR:                     ^
 // CHECK:STDOUT: - filename: fail_require_close_bracket.carbon

+ 1 - 1
toolchain/parse/testdata/array/fail_require_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: Expected `;` in array type.
+// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: ERROR: Expected `;` in array type.
 // CHECK:STDERR: var x: [i32];
 // CHECK:STDERR:            ^
 var x: [i32];

+ 3 - 3
toolchain/parse/testdata/basics/fail_invalid_designators.carbon

@@ -6,15 +6,15 @@
 
 // NOTE: Move to its own directory when more tests are added.
 fn F() {
-  // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: Expected identifier after `.`.
+  // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: ERROR: Expected identifier after `.`.
   // CHECK:STDERR:   a.;
   // CHECK:STDERR:     ^
   a.;
-  // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: Expected identifier after `.`.
+  // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: ERROR: Expected identifier after `.`.
   // CHECK:STDERR:   a.fn;
   // CHECK:STDERR:     ^
   a.fn;
-  // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: Expected identifier after `.`.
+  // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: ERROR: Expected identifier after `.`.
   // CHECK:STDERR:   a.42;
   // CHECK:STDERR:     ^
   a.42;

+ 1 - 1
toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
 // CHECK:STDERR: foo;
 // CHECK:STDERR: ^
 foo;

+ 1 - 1
toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
 // CHECK:STDERR: foo bar baz
 // CHECK:STDERR: ^
 foo bar baz

+ 3 - 3
toolchain/parse/testdata/basics/fail_paren_match_regression.carbon

@@ -4,15 +4,15 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+6]]:5: Expected pattern in `var` declaration.
+// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+6]]:5: ERROR: Expected pattern in `var` declaration.
 // CHECK:STDERR: var = (foo {})
 // CHECK:STDERR:     ^
-// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+3]]:12: Expected `,` or `)`.
+// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+3]]:12: ERROR: Expected `,` or `)`.
 // CHECK:STDERR: var = (foo {})
 // CHECK:STDERR:            ^
 var = (foo {})
 
-// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+15]]:21: `var` declarations must end with a `;`.
+// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+15]]:21: ERROR: `var` declarations must end with a `;`.
 // CHECK:STDERR: // CHECK:STDOUT:   ]
 // CHECK:STDERR:                     ^
 // CHECK:STDOUT: - filename: fail_paren_match_regression.carbon

+ 1 - 1
toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn foo() {
-  // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: `:` should be replaced by `in`.
+  // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: ERROR: `:` should be replaced by `in`.
   // CHECK:STDERR:   for (var x: i32 : y) {
   // CHECK:STDERR:                   ^
   for (var x: i32 : y) {

+ 4 - 4
toolchain/parse/testdata/for/fail_missing_cond.carbon

@@ -5,18 +5,18 @@
 // AUTOUPDATE
 
 fn F() {
-  // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+6]]:7: Expected `(` after `for`.
+  // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+6]]:7: ERROR: Expected `(` after `for`.
   // CHECK:STDERR:   for {
   // CHECK:STDERR:       ^
-  // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:7: Expected `var` declaration.
+  // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:7: ERROR: Expected `var` declaration.
   // CHECK:STDERR:   for {
   // CHECK:STDERR:       ^
   for {
   }
-// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+6]]:1: Expected braced code block.
+// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+6]]:1: ERROR: Expected braced code block.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
-// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: Expected expression.
+// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: ERROR: Expected expression.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }

+ 1 - 1
toolchain/parse/testdata/for/fail_missing_in.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn foo() {
-  // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: Expected `in` after loop `var` declaration.
+  // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: ERROR: Expected `in` after loop `var` declaration.
   // CHECK:STDERR:   for (var x: i32 y) {
   // CHECK:STDERR:                   ^
   for (var x: i32 y) {

+ 1 - 1
toolchain/parse/testdata/for/fail_missing_var.carbon

@@ -5,7 +5,7 @@
 // AUTOUPDATE
 
 fn foo() {
-  // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: Expected `var` declaration.
+  // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: ERROR: Expected `var` declaration.
   // CHECK:STDERR:   for (x: i32 in y) {
   // CHECK:STDERR:        ^
   for (x: i32 in y) {

+ 4 - 4
toolchain/parse/testdata/for/fail_square_brackets.carbon

@@ -5,16 +5,16 @@
 // AUTOUPDATE
 
 fn F() {
-  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+12]]:7: Expected `(` after `for`.
+  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+12]]:7: ERROR: Expected `(` after `for`.
   // CHECK:STDERR:   for [] {
   // CHECK:STDERR:       ^
-  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+9]]:7: Expected `var` declaration.
+  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+9]]:7: ERROR: Expected `var` declaration.
   // CHECK:STDERR:   for [] {
   // CHECK:STDERR:       ^
-  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+6]]:8: Expected expression.
+  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+6]]:8: ERROR: Expected expression.
   // CHECK:STDERR:   for [] {
   // CHECK:STDERR:        ^
-  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: Expected `;` in array type.
+  // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: ERROR: Expected `;` in array type.
   // CHECK:STDERR:   for [] {
   // CHECK:STDERR:        ^
   for [] {

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: `fn` requires a `(` for parameters.
+// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: ERROR: `fn` requires a `(` for parameters.
 // CHECK:STDERR: fn foo bar;
 // CHECK:STDERR:        ^
 fn foo bar;

+ 3 - 3
toolchain/parse/testdata/function/declaration/fail_missing_deduced_close.carbon

@@ -5,15 +5,15 @@
 // AUTOUPDATE
 
 // Fix and uncomment this to test error handling.
-// CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+6]]:7: Closing symbol does not match most recent opening symbol.
+// CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+6]]:7: ERROR: Closing symbol does not match most recent opening symbol.
 // CHECK:STDERR: fn Div[();
 // CHECK:STDERR:       ^
-// CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+3]]:8: Expected parameter declaration.
+// CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+3]]:8: ERROR: Expected parameter declaration.
 // CHECK:STDERR: fn Div[();
 // CHECK:STDERR:        ^
 fn Div[();
 
-// CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+14]]:21: A `(` for parameters is required after deduced parameters.
+// CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+14]]:21: ERROR: A `(` for parameters is required after deduced parameters.
 // CHECK:STDERR: // CHECK:STDOUT:   ]
 // CHECK:STDERR:                     ^
 // CHECK:STDOUT: - filename: fail_missing_deduced_close.carbon

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_missing_name.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn ();
 // CHECK:STDERR:    ^
 fn ();

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon

@@ -6,7 +6,7 @@
 
 fn foo
 
-// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+9]]:21: `fn` requires a `(` for parameters.
+// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+9]]:21: ERROR: `fn` requires a `(` for parameters.
 // CHECK:STDERR: // CHECK:STDOUT:   ]
 // CHECK:STDERR:                     ^
 // CHECK:STDOUT: - filename: fail_no_sig_or_semi.carbon

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn;
 // CHECK:STDERR:   ^
 fn;

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn fn;
 // CHECK:STDERR:    ^
 fn fn;

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-  // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: `fn` introducer should be followed by a name.
+  // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: ERROR: `fn` introducer should be followed by a name.
   // CHECK:STDERR:   fn (x,
   // CHECK:STDERR:      ^
   fn (x,

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn (x,
 // CHECK:STDERR:    ^
 fn (x,

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn (x,
 // CHECK:STDERR:    ^
 fn (x,

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn ()
 // CHECK:STDERR:    ^
 fn ()

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: Unrecognized declaration introducer.
+// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
 // CHECK:STDERR: struct X { fn () }
 // CHECK:STDERR: ^
 struct X { fn () }

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: Expected parameter declaration.
+// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: ERROR: Expected parameter declaration.
 // CHECK:STDERR: fn foo(bar);
 // CHECK:STDERR:           ^
 fn foo(bar);

+ 1 - 1
toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon

@@ -4,7 +4,7 @@
 //
 // AUTOUPDATE
 
-// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: `fn` introducer should be followed by a name.
+// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
 // CHECK:STDERR: fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z);
 // CHECK:STDERR:    ^
 fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z);

+ 1 - 1
toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon

@@ -8,7 +8,7 @@ fn F() {
   // Note: this might become valid depending on the expression syntax. This test
   // shouldn't be taken as a sign it should remain invalid.
   bar
-// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: Expected `;` after expression statement.
+// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: ERROR: Expected `;` after expression statement.
 // CHECK:STDERR: }
 // CHECK:STDERR: ^
 }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä