about summary refs log tree commit diff
path: root/tests/ui/nll/user-annotations
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-09-10 18:47:10 +0200
committerLukas Markeffsky <@>2024-09-24 22:20:42 +0200
commitd1e82d438f9f3d2ce59be210a2710c560e93e688 (patch)
tree06f69d7f065d45c820de22adaa90635e5be2810d /tests/ui/nll/user-annotations
parentb52dea823090223ee2e6faaf08210d085bbc52f2 (diff)
downloadrust-d1e82d438f9f3d2ce59be210a2710c560e93e688.tar.gz
rust-d1e82d438f9f3d2ce59be210a2710c560e93e688.zip
use more accurate spans for user type ascriptions
Diffstat (limited to 'tests/ui/nll/user-annotations')
-rw-r--r--tests/ui/nll/user-annotations/cast_static_lifetime.stderr3
-rw-r--r--tests/ui/nll/user-annotations/type_ascription_static_lifetime.stderr7
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/ui/nll/user-annotations/cast_static_lifetime.stderr b/tests/ui/nll/user-annotations/cast_static_lifetime.stderr
index 35eec233ed5..efd14fe875d 100644
--- a/tests/ui/nll/user-annotations/cast_static_lifetime.stderr
+++ b/tests/ui/nll/user-annotations/cast_static_lifetime.stderr
@@ -4,10 +4,9 @@ error[E0597]: `x` does not live long enough
 LL |     let x = 22_u32;
    |         - binding `x` declared here
 LL |     let y: &u32 = (&x) as &'static u32;
-   |                   ^^^^----------------
+   |                   ^^^^    ------------ type annotation requires that `x` is borrowed for `'static`
    |                   |
    |                   borrowed value does not live long enough
-   |                   type annotation requires that `x` is borrowed for `'static`
 LL | }
    | - `x` dropped here while still borrowed
 
diff --git a/tests/ui/nll/user-annotations/type_ascription_static_lifetime.stderr b/tests/ui/nll/user-annotations/type_ascription_static_lifetime.stderr
index 3e2706309b3..2ed0fadc065 100644
--- a/tests/ui/nll/user-annotations/type_ascription_static_lifetime.stderr
+++ b/tests/ui/nll/user-annotations/type_ascription_static_lifetime.stderr
@@ -4,10 +4,9 @@ error[E0597]: `x` does not live long enough
 LL |     let x = 22_u32;
    |         - binding `x` declared here
 LL |     let y: &u32 = type_ascribe!(&x, &'static u32);
-   |                   --------------^^---------------
-   |                   |             |
-   |                   |             borrowed value does not live long enough
-   |                   type annotation requires that `x` is borrowed for `'static`
+   |                                 ^^  ------------ type annotation requires that `x` is borrowed for `'static`
+   |                                 |
+   |                                 borrowed value does not live long enough
 LL | }
    | - `x` dropped here while still borrowed