about summary refs log tree commit diff
path: root/src/test/ui/compare-method
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2016-10-23 17:22:06 -0700
committerEsteban Küber <esteban@kuber.com.ar>2016-11-22 13:42:36 -0800
commiteb53ca3aad616069cb8f6f8fff71c27e9ba9640c (patch)
tree8b305f44c0527577d57be9cc693465dd3b74f7e5 /src/test/ui/compare-method
parentfb122199aac1fd4f9a3c133e25791a9fcb2a6b83 (diff)
downloadrust-eb53ca3aad616069cb8f6f8fff71c27e9ba9640c.tar.gz
rust-eb53ca3aad616069cb8f6f8fff71c27e9ba9640c.zip
Show multiline spans in full if short enough
When dealing with multiline spans that span few lines, show the complete
span instead of restricting to the first character of the first line.

For example, instead of:

```
% ./rustc foo.rs
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
  --> foo.rs:13:9
   |
13 |    foo(1 + bar(x,
   |        ^ trait `{integer}: std::ops::Add<()>` not satisfied
   |
```

show

```
% ./rustc foo.rs
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
  --> foo.rs:13:9
   |
13 |      foo(1 + bar(x,
   |  ________^ starting here...
14 | |            y),
   | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied
   |
```
Diffstat (limited to 'src/test/ui/compare-method')
-rw-r--r--src/test/ui/compare-method/region-extra-2.stderr12
-rw-r--r--src/test/ui/compare-method/traits-misc-mismatch-2.stderr12
2 files changed, 16 insertions, 8 deletions
diff --git a/src/test/ui/compare-method/region-extra-2.stderr b/src/test/ui/compare-method/region-extra-2.stderr
index 54a551bcfed..12b0ecabcc7 100644
--- a/src/test/ui/compare-method/region-extra-2.stderr
+++ b/src/test/ui/compare-method/region-extra-2.stderr
@@ -1,11 +1,15 @@
 error[E0276]: impl has stricter requirements than trait
   --> $DIR/region-extra-2.rs:19:5
    |
-15 |     fn renew<'b: 'a>(self) -> &'b mut [T];
-   |     -------------------------------------- definition of `renew` from trait
+15 |       fn renew<'b: 'a>(self) -> &'b mut [T];
+   |       -------------------------------------- definition of `renew` from trait
 ...
-19 |     fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
-   |     ^ impl has extra requirement `'a: 'b`
+19 |       fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
+   |  _____^ starting here...
+20 | |         //~^ ERROR E0276
+21 | |         &mut self[..]
+22 | |     }
+   | |_____^ ...ending here: impl has extra requirement `'a: 'b`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/compare-method/traits-misc-mismatch-2.stderr b/src/test/ui/compare-method/traits-misc-mismatch-2.stderr
index 5003550fd1e..77b056f6978 100644
--- a/src/test/ui/compare-method/traits-misc-mismatch-2.stderr
+++ b/src/test/ui/compare-method/traits-misc-mismatch-2.stderr
@@ -1,11 +1,15 @@
 error[E0276]: impl has stricter requirements than trait
   --> $DIR/traits-misc-mismatch-2.rs:23:5
    |
-19 |     fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
-   |     ------------------------------------------------------------------ definition of `zip` from trait
+19 |       fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
+   |       ------------------------------------------------------------------ definition of `zip` from trait
 ...
-23 |     fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
-   |     ^ impl has extra requirement `U: Iterator<B>`
+23 |       fn zip<B, U: Iterator<B>>(self, other: U) -> ZipIterator<T, U> {
+   |  _____^ starting here...
+24 | |     //~^ ERROR E0276
+25 | |         ZipIterator{a: self, b: other}
+26 | |     }
+   | |_____^ ...ending here: impl has extra requirement `U: Iterator<B>`
 
 error: aborting due to previous error