about summary refs log tree commit diff
path: root/tests/ui/methods
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/methods
parent427288b3ce2d574847fdb41cc3184c893750e09a (diff)
downloadrust-20faf8532b5ddeb636ba3078344b0cad058c8f8a.tar.gz
rust-20faf8532b5ddeb636ba3078344b0cad058c8f8a.zip
compiletest: Make diagnostic kind mandatory on line annotations
Diffstat (limited to 'tests/ui/methods')
-rw-r--r--tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs12
-rw-r--r--tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr20
-rw-r--r--tests/ui/methods/method-self-arg-1.rs10
-rw-r--r--tests/ui/methods/method-self-arg-1.stderr8
4 files changed, 27 insertions, 23 deletions
diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs
index 9e53ff07917..5ef1d0c6dc9 100644
--- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs
+++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(arbitrary_self_types, coerce_unsized, dispatch_from_dyn, unsize)]
 #![feature(unsized_locals, unsized_fn_params)]
 //~^ WARN the feature `unsized_locals` is incomplete
@@ -85,7 +87,7 @@ fn objectcandidate_impl() {
 
     // Observe the type of `z` is `u32`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u32`
+    //~| NOTE expected `()`, found `u32`
 }
 
 fn traitcandidate_impl() {
@@ -102,7 +104,7 @@ fn traitcandidate_impl() {
 
     // Observe the type of `z` is `u64`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u64`
+    //~| NOTE expected `()`, found `u64`
 }
 
 fn traitcandidate_impl_with_nuisance() {
@@ -137,7 +139,7 @@ fn neither_impl() {
 
     // Observe the type of `z` is `u8`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u8`
+    //~| NOTE expected `()`, found `u8`
 }
 
 fn both_impls() {
@@ -155,7 +157,7 @@ fn both_impls() {
 
     // Observe the type of `z` is `u32`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u32`
+    //~| NOTE expected `()`, found `u32`
 }
 
 
@@ -172,7 +174,7 @@ fn both_impls_with_nuisance() {
 
     // Observe the type of `z` is `u32`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u32`
+    //~| NOTE expected `()`, found `u32`
 }
 
 fn main() {
diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
index d6da3f2cc39..213139a9b0b 100644
--- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
+++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
@@ -1,5 +1,5 @@
 warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:2:12
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:4:12
    |
 LL | #![feature(unsized_locals, unsized_fn_params)]
    |            ^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(unsized_locals, unsized_fn_params)]
    = note: `#[warn(incomplete_features)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:87:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:89:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u32`
@@ -16,7 +16,7 @@ LL |     let _seetype: () = z;
    |                   expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:104:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:106:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u64`
@@ -24,23 +24,23 @@ LL |     let _seetype: () = z;
    |                   expected due to this
 
 error[E0034]: multiple applicable items in scope
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:122:15
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:124:15
    |
 LL |     let z = x.foo();
    |               ^^^ multiple `foo` found
    |
 note: candidate #1 is defined in the trait `FinalFoo`
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:59:5
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:61:5
    |
 LL |     fn foo(&self) -> u8;
    |     ^^^^^^^^^^^^^^^^^^^^
 note: candidate #2 is defined in an impl of the trait `NuisanceFoo` for the type `T`
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:72:9
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:74:9
    |
 LL |         fn foo(self) {}
    |         ^^^^^^^^^^^^
 note: candidate #3 is defined in an impl of the trait `X` for the type `T`
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:45:9
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:47:9
    |
 LL |         fn foo(self: Smaht<Self, u64>) -> u64 {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL +     let z = X::foo(x);
    |
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:141:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u8`
@@ -69,7 +69,7 @@ LL |     let _seetype: () = z;
    |                   expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:157:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:159:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u32`
@@ -77,7 +77,7 @@ LL |     let _seetype: () = z;
    |                   expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:174:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:176:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u32`
diff --git a/tests/ui/methods/method-self-arg-1.rs b/tests/ui/methods/method-self-arg-1.rs
index 5912b4ec2c3..a0056b540a7 100644
--- a/tests/ui/methods/method-self-arg-1.rs
+++ b/tests/ui/methods/method-self-arg-1.rs
@@ -1,5 +1,7 @@
 // Test method calls with self as an argument cannot subvert type checking.
 
+//@ dont-require-annotations: NOTE
+
 struct Foo;
 
 impl Foo {
@@ -9,9 +11,9 @@ impl Foo {
 fn main() {
     let x = Foo;
     Foo::bar(x); //~  ERROR mismatched types
-                 //~| expected `&Foo`, found `Foo`
+                 //~| NOTE expected `&Foo`, found `Foo`
     Foo::bar(&42); //~  ERROR mismatched types
-                      //~| expected `&Foo`, found `&{integer}`
-                      //~| expected reference `&Foo`
-                      //~| found reference `&{integer}`
+                      //~| NOTE expected `&Foo`, found `&{integer}`
+                      //~| NOTE expected reference `&Foo`
+                      //~| NOTE found reference `&{integer}`
 }
diff --git a/tests/ui/methods/method-self-arg-1.stderr b/tests/ui/methods/method-self-arg-1.stderr
index dcc21acc5c0..1d5927da97f 100644
--- a/tests/ui/methods/method-self-arg-1.stderr
+++ b/tests/ui/methods/method-self-arg-1.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/method-self-arg-1.rs:11:14
+  --> $DIR/method-self-arg-1.rs:13:14
    |
 LL |     Foo::bar(x);
    |     -------- ^ expected `&Foo`, found `Foo`
@@ -7,7 +7,7 @@ LL |     Foo::bar(x);
    |     arguments to this function are incorrect
    |
 note: method defined here
-  --> $DIR/method-self-arg-1.rs:6:8
+  --> $DIR/method-self-arg-1.rs:8:8
    |
 LL |     fn bar(&self) {}
    |        ^^^ -----
@@ -17,7 +17,7 @@ LL |     Foo::bar(&x);
    |              +
 
 error[E0308]: mismatched types
-  --> $DIR/method-self-arg-1.rs:13:14
+  --> $DIR/method-self-arg-1.rs:15:14
    |
 LL |     Foo::bar(&42);
    |     -------- ^^^ expected `&Foo`, found `&{integer}`
@@ -27,7 +27,7 @@ LL |     Foo::bar(&42);
    = note: expected reference `&Foo`
               found reference `&{integer}`
 note: method defined here
-  --> $DIR/method-self-arg-1.rs:6:8
+  --> $DIR/method-self-arg-1.rs:8:8
    |
 LL |     fn bar(&self) {}
    |        ^^^ -----