Skip to content

Commit 2938d92

Browse files
committed
Add a regression test for public struct field spans
1 parent a722838 commit 2938d92

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Regression test for issue #26083
2+
// Test that span for public struct fields start at `pub` instead of the identifier
3+
4+
struct Foo {
5+
pub bar: u8,
6+
7+
pub
8+
//~^ error: field `bar` is already declared [E0124]
9+
bar: u8,
10+
11+
pub bar:
12+
//~^ error: field `bar` is already declared [E0124]
13+
u8,
14+
15+
bar:
16+
//~^ error: field `bar` is already declared [E0124]
17+
u8,
18+
}
19+
20+
fn main() { }

0 commit comments

Comments
 (0)