about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-04-05 19:19:56 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-04-30 10:44:24 +0300
commit20faf8532b5ddeb636ba3078344b0cad058c8f8a (patch)
tree04512e985a99a3715b4a0829826be7139fdcee09 /tests/ui/error-codes
parent427288b3ce2d574847fdb41cc3184c893750e09a (diff)
downloadrust-20faf8532b5ddeb636ba3078344b0cad058c8f8a.tar.gz
rust-20faf8532b5ddeb636ba3078344b0cad058c8f8a.zip
compiletest: Make diagnostic kind mandatory on line annotations
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0080.rs3
-rw-r--r--tests/ui/error-codes/E0106.rs6
-rw-r--r--tests/ui/error-codes/E0106.stderr10
-rw-r--r--tests/ui/error-codes/E0428.rs4
-rw-r--r--tests/ui/error-codes/E0428.stderr2
5 files changed, 15 insertions, 10 deletions
diff --git a/tests/ui/error-codes/E0080.rs b/tests/ui/error-codes/E0080.rs
index ea3264b61b3..55f45055f01 100644
--- a/tests/ui/error-codes/E0080.rs
+++ b/tests/ui/error-codes/E0080.rs
@@ -1,7 +1,8 @@
 enum Enum {
     X = (1 << 500), //~ ERROR E0080
-    //~| attempt to shift left by `500_i32`, which would overflow
+    //~| NOTE attempt to shift left by `500_i32`, which would overflow
     Y = (1 / 0) //~ ERROR E0080
+                //~| NOTE attempt to divide `1_isize` by zero
 }
 
 fn main() {
diff --git a/tests/ui/error-codes/E0106.rs b/tests/ui/error-codes/E0106.rs
index cc3438727a8..c8030495628 100644
--- a/tests/ui/error-codes/E0106.rs
+++ b/tests/ui/error-codes/E0106.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo {
     x: &bool,
     //~^ ERROR E0106
@@ -16,10 +18,10 @@ struct Buzz<'a, 'b>(&'a str, &'b str);
 struct Quux {
     baz: Baz,
     //~^ ERROR E0106
-    //~| expected named lifetime parameter
+    //~| NOTE expected named lifetime parameter
     buzz: Buzz,
     //~^ ERROR E0106
-    //~| expected 2 lifetime parameters
+    //~| NOTE expected 2 lifetime parameters
 }
 
 fn main() {
diff --git a/tests/ui/error-codes/E0106.stderr b/tests/ui/error-codes/E0106.stderr
index d11a24f7768..97ae1df9873 100644
--- a/tests/ui/error-codes/E0106.stderr
+++ b/tests/ui/error-codes/E0106.stderr
@@ -1,5 +1,5 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:2:8
+  --> $DIR/E0106.rs:4:8
    |
 LL |     x: &bool,
    |        ^ expected named lifetime parameter
@@ -11,7 +11,7 @@ LL ~     x: &'a bool,
    |
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:7:7
+  --> $DIR/E0106.rs:9:7
    |
 LL |     B(&bool),
    |       ^ expected named lifetime parameter
@@ -24,7 +24,7 @@ LL ~     B(&'a bool),
    |
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:10:14
+  --> $DIR/E0106.rs:12:14
    |
 LL | type MyStr = &str;
    |              ^ expected named lifetime parameter
@@ -35,7 +35,7 @@ LL | type MyStr<'a> = &'a str;
    |           ++++    ++
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:17:10
+  --> $DIR/E0106.rs:19:10
    |
 LL |     baz: Baz,
    |          ^^^ expected named lifetime parameter
@@ -47,7 +47,7 @@ LL ~     baz: Baz<'a>,
    |
 
 error[E0106]: missing lifetime specifiers
-  --> $DIR/E0106.rs:20:11
+  --> $DIR/E0106.rs:22:11
    |
 LL |     buzz: Buzz,
    |           ^^^^ expected 2 lifetime parameters
diff --git a/tests/ui/error-codes/E0428.rs b/tests/ui/error-codes/E0428.rs
index eb9594fb8b6..08393b009d5 100644
--- a/tests/ui/error-codes/E0428.rs
+++ b/tests/ui/error-codes/E0428.rs
@@ -1,4 +1,6 @@
-struct Bar; //~ previous definition of the type `Bar` here
+//@ dont-require-annotations: NOTE
+
+struct Bar; //~ NOTE previous definition of the type `Bar` here
 struct Bar; //~ ERROR E0428
 
 fn main () {
diff --git a/tests/ui/error-codes/E0428.stderr b/tests/ui/error-codes/E0428.stderr
index b5bb84e2e68..78f57066e26 100644
--- a/tests/ui/error-codes/E0428.stderr
+++ b/tests/ui/error-codes/E0428.stderr
@@ -1,5 +1,5 @@
 error[E0428]: the name `Bar` is defined multiple times
-  --> $DIR/E0428.rs:2:1
+  --> $DIR/E0428.rs:4:1
    |
 LL | struct Bar;
    | ----------- previous definition of the type `Bar` here