Skip to content

Commit 85f5738

Browse files
committed
Fix tuple struct field spans
1 parent e5f80f2 commit 85f5738

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5741,7 +5741,7 @@ impl<'a> Parser<'a> {
57415741
let vis = p.parse_visibility(true)?;
57425742
let ty = p.parse_ty()?;
57435743
Ok(StructField {
5744-
span: lo.to(p.span),
5744+
span: lo.to(ty.span),
57455745
vis,
57465746
ident: None,
57475747
id: ast::DUMMY_NODE_ID,

src/test/ui/issue-3008-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | enum Bar {
55
| ^^^^^^^^ recursive type has infinite size
66
...
77
LL | BarSome(Bar)
8-
| ---- recursive without indirection
8+
| --- recursive without indirection
99
|
1010
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable
1111

src/test/ui/issue-32326.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0072]: recursive type `Expr` has infinite size
44
LL | enum Expr { //~ ERROR E0072
55
| ^^^^^^^^^ recursive type has infinite size
66
LL | Plus(Expr, Expr),
7-
| ----- ----- recursive without indirection
7+
| ---- ---- recursive without indirection
88
| |
99
| recursive without indirection
1010
|

src/test/ui/rfc-2093-infer-outlives/enum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ enum Foo<'a, T> {
2020

2121
// Type U needs to outlive lifetime 'b
2222
struct Bar<'b, U> {
23-
field2: &'b U //~ ERROR 23:5: 23:18: the parameter type `U` may not live long enough [E0309]
23+
field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
2424
}
2525

2626

2727

2828
// Type K needs to outlive lifetime 'c.
2929
enum Ying<'c, K> {
30-
One(&'c Yang<K>) //~ ERROR 30:9: 30:21: the parameter type `K` may not live long enough [E0309]
30+
One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
3131
}
3232

3333
struct Yang<V> {

src/test/ui/rfc-2093-infer-outlives/enum.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ error[E0309]: the parameter type `U` may not live long enough
33
|
44
LL | struct Bar<'b, U> {
55
| - help: consider adding an explicit lifetime bound `U: 'b`...
6-
LL | field2: &'b U //~ ERROR 23:5: 23:18: the parameter type `U` may not live long enough [E0309]
6+
LL | field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
77
| ^^^^^^^^^^^^^
88
|
99
note: ...so that the reference type `&'b U` does not outlive the data it points at
1010
--> $DIR/enum.rs:23:5
1111
|
12-
LL | field2: &'b U //~ ERROR 23:5: 23:18: the parameter type `U` may not live long enough [E0309]
12+
LL | field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
1313
| ^^^^^^^^^^^^^
1414

1515
error[E0309]: the parameter type `K` may not live long enough
1616
--> $DIR/enum.rs:30:9
1717
|
1818
LL | enum Ying<'c, K> {
1919
| - help: consider adding an explicit lifetime bound `K: 'c`...
20-
LL | One(&'c Yang<K>) //~ ERROR 30:9: 30:21: the parameter type `K` may not live long enough [E0309]
21-
| ^^^^^^^^^^^^
20+
LL | One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
21+
| ^^^^^^^^^^^
2222
|
2323
note: ...so that the reference type `&'c Yang<K>` does not outlive the data it points at
2424
--> $DIR/enum.rs:30:9
2525
|
26-
LL | One(&'c Yang<K>) //~ ERROR 30:9: 30:21: the parameter type `K` may not live long enough [E0309]
27-
| ^^^^^^^^^^^^
26+
LL | One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
27+
| ^^^^^^^^^^^
2828

2929
error: aborting due to 2 previous errors
3030

src/test/ui/span/E0204.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LL | #[derive(Copy)] //~ ERROR may not be implemented for this type
3232
| ^^^^
3333
LL | enum EFoo2<'a> {
3434
LL | Bar(&'a mut bool),
35-
| ------------- this field does not implement `Copy`
35+
| ------------ this field does not implement `Copy`
3636

3737
error: aborting due to 4 previous errors
3838

src/test/ui/union/union-sized-field.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
2222
--> $DIR/union-sized-field.rs:23:11
2323
|
2424
LL | Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
25-
| ^^ `T` does not have a constant size known at compile-time
25+
| ^ `T` does not have a constant size known at compile-time
2626
|
2727
= help: the trait `std::marker::Sized` is not implemented for `T`
2828
= help: consider adding a `where T: std::marker::Sized` bound

src/test/ui/unsized-enum2.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `W: std::marker::Sized` is not satisfied
22
--> $DIR/unsized-enum2.rs:33:8
33
|
44
LL | VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied
5-
| ^^ `W` does not have a constant size known at compile-time
5+
| ^ `W` does not have a constant size known at compile-time
66
|
77
= help: the trait `std::marker::Sized` is not implemented for `W`
88
= 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
2222
--> $DIR/unsized-enum2.rs:35:15
2323
|
2424
LL | VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied
25-
| ^^ `Y` does not have a constant size known at compile-time
25+
| ^ `Y` does not have a constant size known at compile-time
2626
|
2727
= help: the trait `std::marker::Sized` is not implemented for `Y`
2828
= 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
4242
--> $DIR/unsized-enum2.rs:39:8
4343
|
4444
LL | VE([u8]), //~ ERROR `[u8]: std::marker::Sized` is not satisfied
45-
| ^^^^^ `[u8]` does not have a constant size known at compile-time
45+
| ^^^^ `[u8]` does not have a constant size known at compile-time
4646
|
4747
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
4848
= 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
6060
--> $DIR/unsized-enum2.rs:41:15
6161
|
6262
LL | VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied
63-
| ^^^^^^ `[f32]` does not have a constant size known at compile-time
63+
| ^^^^^ `[f32]` does not have a constant size known at compile-time
6464
|
6565
= help: the trait `std::marker::Sized` is not implemented for `[f32]`
6666
= 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
7878
--> $DIR/unsized-enum2.rs:51:8
7979
|
8080
LL | VM(Foo), //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied
81-
| ^^^^ `Foo + 'static` does not have a constant size known at compile-time
81+
| ^^^ `Foo + 'static` does not have a constant size known at compile-time
8282
|
8383
= help: the trait `std::marker::Sized` is not implemented for `Foo + 'static`
8484
= 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
9696
--> $DIR/unsized-enum2.rs:53:15
9797
|
9898
LL | VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied
99-
| ^^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time
99+
| ^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time
100100
|
101101
= help: the trait `std::marker::Sized` is not implemented for `FooBar + 'static`
102102
= 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
114114
--> $DIR/unsized-enum2.rs:57:8
115115
|
116116
LL | VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied
117-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time
117+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time
118118
|
119119
= help: the trait `std::marker::Sized` is not implemented for `[i8]`
120120
= 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
132132
--> $DIR/unsized-enum2.rs:60:15
133133
|
134134
LL | VS(isize, <&'static [f64] as Deref>::Target),
135-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time
135+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time
136136
|
137137
= help: the trait `std::marker::Sized` is not implemented for `[f64]`
138138
= 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
150150
--> $DIR/unsized-enum2.rs:45:8
151151
|
152152
LL | VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied
153-
| ^^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time
153+
| ^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time
154154
|
155155
= help: within `Path1`, the trait `std::marker::Sized` is not implemented for `PathHelper1 + 'static`
156156
= 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
170170
--> $DIR/unsized-enum2.rs:47:15
171171
|
172172
LL | VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied
173-
| ^^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time
173+
| ^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time
174174
|
175175
= help: within `Path3`, the trait `std::marker::Sized` is not implemented for `PathHelper3 + 'static`
176176
= note: required because it appears within the type `Path3`

0 commit comments

Comments
 (0)