about summary refs log tree commit diff
path: root/tests/ui/nll/user-annotations
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2024-12-19 01:16:53 -0800
committerdianne <diannes.gm@gmail.com>2025-01-06 16:12:11 -0800
commit50222dba2edd2bcf265a8ca4753de0df59bf587d (patch)
tree80fbafb856e71cb4bf733562ade3931efebb3e62 /tests/ui/nll/user-annotations
parent31e4d8175a3ef5d10f2319e98a20ca6c81614487 (diff)
downloadrust-50222dba2edd2bcf265a8ca4753de0df59bf587d.tar.gz
rust-50222dba2edd2bcf265a8ca4753de0df59bf587d.zip
`best_blame_constraint`: avoid blaming assignments without user-provided types
Diffstat (limited to 'tests/ui/nll/user-annotations')
-rw-r--r--tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr18
-rw-r--r--tests/ui/nll/user-annotations/method-ufcs-1.stderr7
-rw-r--r--tests/ui/nll/user-annotations/method-ufcs-2.stderr7
-rw-r--r--tests/ui/nll/user-annotations/promoted-annotation.stderr6
4 files changed, 24 insertions, 14 deletions
diff --git a/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr b/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
index 1478ad1431b..2084697e7e2 100644
--- a/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
+++ b/tests/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
@@ -4,9 +4,11 @@ error[E0597]: `c` does not live long enough
 LL |     let c = 66;
    |         - binding `c` declared here
 LL |     let f = SomeStruct::<&'static u32>;
-   |             -------------------------- assignment requires that `c` is borrowed for `'static`
 LL |     f(&c);
-   |       ^^ borrowed value does not live long enough
+   |     --^^-
+   |     | |
+   |     | borrowed value does not live long enough
+   |     argument requires that `c` is borrowed for `'static`
 LL | }
    | - `c` dropped here while still borrowed
 
@@ -18,9 +20,11 @@ LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) {
 LL |     let c = 66;
    |         - binding `c` declared here
 LL |     let f = SomeStruct::<&'a u32>;
-   |             --------------------- assignment requires that `c` is borrowed for `'a`
 LL |     f(&c);
-   |       ^^ borrowed value does not live long enough
+   |     --^^-
+   |     | |
+   |     | borrowed value does not live long enough
+   |     argument requires that `c` is borrowed for `'a`
 LL | }
    | - `c` dropped here while still borrowed
 
@@ -33,9 +37,11 @@ LL |     let _closure = || {
 LL |         let c = 66;
    |             - binding `c` declared here
 LL |         let f = SomeStruct::<&'a u32>;
-   |                 --------------------- assignment requires that `c` is borrowed for `'a`
 LL |         f(&c);
-   |           ^^ borrowed value does not live long enough
+   |         --^^-
+   |         | |
+   |         | borrowed value does not live long enough
+   |         argument requires that `c` is borrowed for `'a`
 LL |     };
    |     - `c` dropped here while still borrowed
 
diff --git a/tests/ui/nll/user-annotations/method-ufcs-1.stderr b/tests/ui/nll/user-annotations/method-ufcs-1.stderr
index 087e270c70f..c42ea0172cf 100644
--- a/tests/ui/nll/user-annotations/method-ufcs-1.stderr
+++ b/tests/ui/nll/user-annotations/method-ufcs-1.stderr
@@ -4,10 +4,11 @@ error[E0597]: `a` does not live long enough
 LL |     let a = 22;
    |         - binding `a` declared here
 ...
-LL |     let x = <&'static u32 as Bazoom<_>>::method;
-   |             ----------------------------------- assignment requires that `a` is borrowed for `'static`
 LL |     x(&a, b, c);
-   |       ^^ borrowed value does not live long enough
+   |     --^^-------
+   |     | |
+   |     | borrowed value does not live long enough
+   |     argument requires that `a` is borrowed for `'static`
 LL | }
    | - `a` dropped here while still borrowed
 
diff --git a/tests/ui/nll/user-annotations/method-ufcs-2.stderr b/tests/ui/nll/user-annotations/method-ufcs-2.stderr
index c89bed3b1b1..287337c7d52 100644
--- a/tests/ui/nll/user-annotations/method-ufcs-2.stderr
+++ b/tests/ui/nll/user-annotations/method-ufcs-2.stderr
@@ -4,10 +4,11 @@ error[E0597]: `a` does not live long enough
 LL |     let a = 22;
    |         - binding `a` declared here
 ...
-LL |     let x = <&'static u32 as Bazoom<_>>::method;
-   |             ----------------------------------- assignment requires that `a` is borrowed for `'static`
 LL |     x(&a, b, c);
-   |       ^^ borrowed value does not live long enough
+   |     --^^-------
+   |     | |
+   |     | borrowed value does not live long enough
+   |     argument requires that `a` is borrowed for `'static`
 LL | }
    | - `a` dropped here while still borrowed
 
diff --git a/tests/ui/nll/user-annotations/promoted-annotation.stderr b/tests/ui/nll/user-annotations/promoted-annotation.stderr
index ca99e531870..39993475796 100644
--- a/tests/ui/nll/user-annotations/promoted-annotation.stderr
+++ b/tests/ui/nll/user-annotations/promoted-annotation.stderr
@@ -6,9 +6,11 @@ LL | fn foo<'a>() {
 LL |     let x = 0;
    |         - binding `x` declared here
 LL |     let f = &drop::<&'a i32>;
-   |             ---------------- assignment requires that `x` is borrowed for `'a`
 LL |     f(&x);
-   |       ^^ borrowed value does not live long enough
+   |     --^^-
+   |     | |
+   |     | borrowed value does not live long enough
+   |     argument requires that `x` is borrowed for `'a`
 LL |
 LL | }
    | - `x` dropped here while still borrowed