about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-05-10 11:35:34 -0500
committerGitHub <noreply@github.com>2018-05-10 11:35:34 -0500
commit1f1c65de4a8a9a10822012c065174bd24409e15a (patch)
tree35736637c19eed73cb76d85c90ff5041dfe4d6a8
parentc798cbbb2cd5a0300954cdcb08f2daa0817898ff (diff)
parent85f57389bf42c3a3ab648f4662580c84d9bfdd4d (diff)
downloadrust-1f1c65de4a8a9a10822012c065174bd24409e15a.tar.gz
rust-1f1c65de4a8a9a10822012c065174bd24409e15a.zip
Rollup merge of #50590 - estebank:off-by-one, r=nikomatsakis
Fix tuple struct field spans

Fix #50578. Will have a merge conflict with #50536.
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/test/ui/issue-3008-1.stderr2
-rw-r--r--src/test/ui/issue-32326.stderr2
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/enum.rs4
-rw-r--r--src/test/ui/rfc-2093-infer-outlives/enum.stderr12
-rw-r--r--src/test/ui/span/E0204.stderr2
-rw-r--r--src/test/ui/union/union-sized-field.stderr2
-rw-r--r--src/test/ui/unsized-enum2.stderr20
8 files changed, 23 insertions, 23 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index bf4a68679df..49b30c6f460 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5741,7 +5741,7 @@ impl<'a> Parser<'a> {
                 let vis = p.parse_visibility(true)?;
                 let ty = p.parse_ty()?;
                 Ok(StructField {
-                    span: lo.to(p.span),
+                    span: lo.to(ty.span),
                     vis,
                     ident: None,
                     id: ast::DUMMY_NODE_ID,
diff --git a/src/test/ui/issue-3008-1.stderr b/src/test/ui/issue-3008-1.stderr
index 05c1f2aae81..fe3e294d9e3 100644
--- a/src/test/ui/issue-3008-1.stderr
+++ b/src/test/ui/issue-3008-1.stderr
@@ -5,7 +5,7 @@ LL | enum Bar {
    | ^^^^^^^^ recursive type has infinite size
 ...
 LL |     BarSome(Bar)
-   |             ---- recursive without indirection
+   |             --- recursive without indirection
    |
    = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable
 
diff --git a/src/test/ui/issue-32326.stderr b/src/test/ui/issue-32326.stderr
index 1aa99c402ed..b7e359af64a 100644
--- a/src/test/ui/issue-32326.stderr
+++ b/src/test/ui/issue-32326.stderr
@@ -4,7 +4,7 @@ error[E0072]: recursive type `Expr` has infinite size
 LL | enum Expr { //~ ERROR E0072
    | ^^^^^^^^^ recursive type has infinite size
 LL |     Plus(Expr, Expr),
-   |          ----- ----- recursive without indirection
+   |          ----  ---- recursive without indirection
    |          |
    |          recursive without indirection
    |
diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.rs b/src/test/ui/rfc-2093-infer-outlives/enum.rs
index 7d0427adb9f..5071465b5f6 100644
--- a/src/test/ui/rfc-2093-infer-outlives/enum.rs
+++ b/src/test/ui/rfc-2093-infer-outlives/enum.rs
@@ -20,14 +20,14 @@ enum Foo<'a, T> {
 
 // Type U needs to outlive lifetime 'b
 struct Bar<'b, U> {
-    field2: &'b U //~ ERROR 23:5: 23:18: the parameter type `U` may not live long enough [E0309]
+    field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
 }
 
 
 
 // Type K needs to outlive lifetime 'c.
 enum Ying<'c, K> {
-    One(&'c Yang<K>) //~ ERROR 30:9: 30:21: the parameter type `K` may not live long enough [E0309]
+    One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
 }
 
 struct Yang<V> {
diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.stderr b/src/test/ui/rfc-2093-infer-outlives/enum.stderr
index e6eaf9b4754..604dd0b43c0 100644
--- a/src/test/ui/rfc-2093-infer-outlives/enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/enum.stderr
@@ -3,13 +3,13 @@ error[E0309]: the parameter type `U` may not live long enough
    |
 LL | struct Bar<'b, U> {
    |                - help: consider adding an explicit lifetime bound `U: 'b`...
-LL |     field2: &'b U //~ ERROR 23:5: 23:18: the parameter type `U` may not live long enough [E0309]
+LL |     field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
    |     ^^^^^^^^^^^^^
    |
 note: ...so that the reference type `&'b U` does not outlive the data it points at
   --> $DIR/enum.rs:23:5
    |
-LL |     field2: &'b U //~ ERROR 23:5: 23:18: the parameter type `U` may not live long enough [E0309]
+LL |     field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
    |     ^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `K` may not live long enough
@@ -17,14 +17,14 @@ error[E0309]: the parameter type `K` may not live long enough
    |
 LL | enum Ying<'c, K> {
    |               - help: consider adding an explicit lifetime bound `K: 'c`...
-LL |     One(&'c Yang<K>) //~ ERROR 30:9: 30:21: the parameter type `K` may not live long enough [E0309]
-   |         ^^^^^^^^^^^^
+LL |     One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
+   |         ^^^^^^^^^^^
    |
 note: ...so that the reference type `&'c Yang<K>` does not outlive the data it points at
   --> $DIR/enum.rs:30:9
    |
-LL |     One(&'c Yang<K>) //~ ERROR 30:9: 30:21: the parameter type `K` may not live long enough [E0309]
-   |         ^^^^^^^^^^^^
+LL |     One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
+   |         ^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr
index 8be1af61d80..2949a22747b 100644
--- a/src/test/ui/span/E0204.stderr
+++ b/src/test/ui/span/E0204.stderr
@@ -32,7 +32,7 @@ LL | #[derive(Copy)] //~ ERROR may not be implemented for this type
    |          ^^^^
 LL | enum EFoo2<'a> {
 LL |     Bar(&'a mut bool),
-   |         ------------- this field does not implement `Copy`
+   |         ------------ this field does not implement `Copy`
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/union/union-sized-field.stderr b/src/test/ui/union/union-sized-field.stderr
index fb81a7b695d..ba80af6c7e0 100644
--- a/src/test/ui/union/union-sized-field.stderr
+++ b/src/test/ui/union/union-sized-field.stderr
@@ -22,7 +22,7 @@ error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
   --> $DIR/union-sized-field.rs:23:11
    |
 LL |     Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
-   |           ^^ `T` does not have a constant size known at compile-time
+   |           ^ `T` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
    = help: consider adding a `where T: std::marker::Sized` bound
diff --git a/src/test/ui/unsized-enum2.stderr b/src/test/ui/unsized-enum2.stderr
index c05c1cfe412..0e18efbf9da 100644
--- a/src/test/ui/unsized-enum2.stderr
+++ b/src/test/ui/unsized-enum2.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `W: std::marker::Sized` is not satisfied
   --> $DIR/unsized-enum2.rs:33:8
    |
 LL |     VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied
-   |        ^^ `W` does not have a constant size known at compile-time
+   |        ^ `W` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `W`
    = help: consider adding a `where W: std::marker::Sized` bound
@@ -22,7 +22,7 @@ error[E0277]: the trait bound `Y: std::marker::Sized` is not satisfied
   --> $DIR/unsized-enum2.rs:35:15
    |
 LL |     VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied
-   |               ^^ `Y` does not have a constant size known at compile-time
+   |               ^ `Y` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Y`
    = help: consider adding a `where Y: std::marker::Sized` bound
@@ -42,7 +42,7 @@ error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
   --> $DIR/unsized-enum2.rs:39:8
    |
 LL |     VE([u8]), //~ ERROR `[u8]: std::marker::Sized` is not satisfied
-   |        ^^^^^ `[u8]` does not have a constant size known at compile-time
+   |        ^^^^ `[u8]` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[u8]`
    = note: no field of an enum variant may have a dynamically sized type
@@ -60,7 +60,7 @@ error[E0277]: the trait bound `[f32]: std::marker::Sized` is not satisfied
   --> $DIR/unsized-enum2.rs:41:15
    |
 LL |     VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied
-   |               ^^^^^^ `[f32]` does not have a constant size known at compile-time
+   |               ^^^^^ `[f32]` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[f32]`
    = note: no field of an enum variant may have a dynamically sized type
@@ -78,7 +78,7 @@ error[E0277]: the trait bound `Foo + 'static: std::marker::Sized` is not satisfi
   --> $DIR/unsized-enum2.rs:51:8
    |
 LL |     VM(Foo),  //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied
-   |        ^^^^ `Foo + 'static` does not have a constant size known at compile-time
+   |        ^^^ `Foo + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Foo + 'static`
    = note: no field of an enum variant may have a dynamically sized type
@@ -96,7 +96,7 @@ error[E0277]: the trait bound `FooBar + 'static: std::marker::Sized` is not sati
   --> $DIR/unsized-enum2.rs:53:15
    |
 LL |     VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied
-   |               ^^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time
+   |               ^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `FooBar + 'static`
    = note: no field of an enum variant may have a dynamically sized type
@@ -114,7 +114,7 @@ error[E0277]: the trait bound `[i8]: std::marker::Sized` is not satisfied
   --> $DIR/unsized-enum2.rs:57:8
    |
 LL |     VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[i8]`
    = note: no field of an enum variant may have a dynamically sized type
@@ -132,7 +132,7 @@ error[E0277]: the trait bound `[f64]: std::marker::Sized` is not satisfied
   --> $DIR/unsized-enum2.rs:60:15
    |
 LL |     VS(isize, <&'static [f64] as Deref>::Target),
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[f64]`
    = note: no field of an enum variant may have a dynamically sized type
@@ -150,7 +150,7 @@ error[E0277]: the trait bound `PathHelper1 + 'static: std::marker::Sized` is not
   --> $DIR/unsized-enum2.rs:45:8
    |
 LL |     VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied
-   |        ^^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time
+   |        ^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time
    |
    = help: within `Path1`, the trait `std::marker::Sized` is not implemented for `PathHelper1 + 'static`
    = note: required because it appears within the type `Path1`
@@ -170,7 +170,7 @@ error[E0277]: the trait bound `PathHelper3 + 'static: std::marker::Sized` is not
   --> $DIR/unsized-enum2.rs:47:15
    |
 LL |     VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied
-   |               ^^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time
+   |               ^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time
    |
    = help: within `Path3`, the trait `std::marker::Sized` is not implemented for `PathHelper3 + 'static`
    = note: required because it appears within the type `Path3`