about summary refs log tree commit diff
path: root/src/test/ui/lifetime-errors
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-04-14 16:38:10 -0700
committerEsteban Küber <esteban@kuber.com.ar>2017-04-20 17:31:20 -0700
commitcc07c357e421eebff58eb6948c8e1412ae7d8069 (patch)
tree560bdd78cbfc03646386e6d8ed881c901f4bda79 /src/test/ui/lifetime-errors
parent968ae7babecfc6c62ef9699ff052d9ab00411848 (diff)
Reduce visual clutter of multiline start when possible
When a span starts on a line with nothing but whitespace to the left,
and there are no other annotations in that line, simplify the visual
representation of the span.

Go from:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 |   struct A {
  |  _^ starting here...
2 | |     a: A,
3 | | }
  | |_^ ...ending here: recursive type has infinite size
  |
```

To:

```rust
error[E0072]: recursive type `A` has infinite size
 --> file2.rs:1:1
  |
1 | / struct A {
2 | |     a: A,
3 | | }
  | |_^ recursive type has infinite size
```

Remove `starting here...`/`...ending here` labels from all multiline
diagnostics.
Diffstat (limited to 'src/test/ui/lifetime-errors')
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr8
-rw-r--r--src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr8
6 files changed, 24 insertions, 24 deletions
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
index 85e05422ab3..cf272b63128 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
@@ -8,18 +8,18 @@ note: ...the reference is valid for the lifetime 'a as defined on the body at 11
   --> $DIR/ex1-return-one-existing-name-if-else.rs:11:44
    |
 11 |   fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-   |  ____________________________________________^ starting here...
+   |  ____________________________________________^
 12 | |     if x > y { x } else { y }
 13 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...but the borrowed content is only valid for the anonymous lifetime #1 defined on the body at 11:43
   --> $DIR/ex1-return-one-existing-name-if-else.rs:11:44
    |
 11 |   fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-   |  ____________________________________________^ starting here...
+   |  ____________________________________________^
 12 | |     if x > y { x } else { y }
 13 | | }
-   | |_^ ...ending here
+   | |_^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
index 6956a043cc6..6e03e66dd25 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
@@ -10,18 +10,18 @@ note: the anonymous lifetime #2 defined on the body at 15:51...
   --> $DIR/ex2a-push-one-existing-name.rs:15:52
    |
 15 |   fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |  ____________________________________________________^ starting here...
+   |  ____________________________________________________^
 16 | |     x.push(y);
 17 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...does not necessarily outlive the lifetime 'a as defined on the body at 15:51
   --> $DIR/ex2a-push-one-existing-name.rs:15:52
    |
 15 |   fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |  ____________________________________________________^ starting here...
+   |  ____________________________________________________^
 16 | |     x.push(y);
 17 | | }
-   | |_^ ...ending here
+   | |_^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr
index 990ae65ba98..028f54ce978 100644
--- a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr
+++ b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr
@@ -10,18 +10,18 @@ note: the anonymous lifetime #3 defined on the body at 15:43...
   --> $DIR/ex2b-push-no-existing-names.rs:15:44
    |
 15 |   fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-   |  ____________________________________________^ starting here...
+   |  ____________________________________________^
 16 | |     x.push(y);
 17 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 15:43
   --> $DIR/ex2b-push-no-existing-names.rs:15:44
    |
 15 |   fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-   |  ____________________________________________^ starting here...
+   |  ____________________________________________^
 16 | |     x.push(y);
 17 | | }
-   | |_^ ...ending here
+   | |_^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr
index 82f6c71ec1c..4621214419e 100644
--- a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr
+++ b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr
@@ -8,11 +8,11 @@ note: first, the lifetime cannot outlive the lifetime 'c as defined on the body
   --> $DIR/ex2c-push-inference-variable.rs:15:67
    |
 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |  ___________________________________________________________________^ starting here...
+   |  ___________________________________________________________________^
 16 | |     let z = Ref { data: y.data };
 17 | |     x.push(z);
 18 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...so that reference does not outlive borrowed content
   --> $DIR/ex2c-push-inference-variable.rs:16:25
    |
@@ -22,11 +22,11 @@ note: but, the lifetime must be valid for the lifetime 'b as defined on the body
   --> $DIR/ex2c-push-inference-variable.rs:15:67
    |
 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |  ___________________________________________________________________^ starting here...
+   |  ___________________________________________________________________^
 16 | |     let z = Ref { data: y.data };
 17 | |     x.push(z);
 18 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...so that expression is assignable (expected Ref<'b, _>, found Ref<'_, _>)
   --> $DIR/ex2c-push-inference-variable.rs:17:12
    |
diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr
index daa6ea2d91a..a69694fdc2e 100644
--- a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr
+++ b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr
@@ -8,12 +8,12 @@ note: first, the lifetime cannot outlive the lifetime 'c as defined on the body
   --> $DIR/ex2d-push-inference-variable-2.rs:15:67
    |
 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |  ___________________________________________________________________^ starting here...
+   |  ___________________________________________________________________^
 16 | |     let a: &mut Vec<Ref<i32>> = x;
 17 | |     let b = Ref { data: y.data };
 18 | |     a.push(b);
 19 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...so that reference does not outlive borrowed content
   --> $DIR/ex2d-push-inference-variable-2.rs:17:25
    |
@@ -23,12 +23,12 @@ note: but, the lifetime must be valid for the lifetime 'b as defined on the body
   --> $DIR/ex2d-push-inference-variable-2.rs:15:67
    |
 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |  ___________________________________________________________________^ starting here...
+   |  ___________________________________________________________________^
 16 | |     let a: &mut Vec<Ref<i32>> = x;
 17 | |     let b = Ref { data: y.data };
 18 | |     a.push(b);
 19 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...so that expression is assignable (expected &mut std::vec::Vec<Ref<'_, i32>>, found &mut std::vec::Vec<Ref<'b, i32>>)
   --> $DIR/ex2d-push-inference-variable-2.rs:16:33
    |
diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr
index b679532a4d9..eff15bb794b 100644
--- a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr
+++ b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr
@@ -8,12 +8,12 @@ note: first, the lifetime cannot outlive the lifetime 'c as defined on the body
   --> $DIR/ex2e-push-inference-variable-3.rs:15:67
    |
 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |  ___________________________________________________________________^ starting here...
+   |  ___________________________________________________________________^
 16 | |     let a: &mut Vec<Ref<i32>> = x;
 17 | |     let b = Ref { data: y.data };
 18 | |     Vec::push(a, b);
 19 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...so that reference does not outlive borrowed content
   --> $DIR/ex2e-push-inference-variable-3.rs:17:25
    |
@@ -23,12 +23,12 @@ note: but, the lifetime must be valid for the lifetime 'b as defined on the body
   --> $DIR/ex2e-push-inference-variable-3.rs:15:67
    |
 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |  ___________________________________________________________________^ starting here...
+   |  ___________________________________________________________________^
 16 | |     let a: &mut Vec<Ref<i32>> = x;
 17 | |     let b = Ref { data: y.data };
 18 | |     Vec::push(a, b);
 19 | | }
-   | |_^ ...ending here
+   | |_^
 note: ...so that expression is assignable (expected &mut std::vec::Vec<Ref<'_, i32>>, found &mut std::vec::Vec<Ref<'b, i32>>)
   --> $DIR/ex2e-push-inference-variable-3.rs:16:33
    |