Add a regression test for public struct field spans
This commit is contained in:
parent
a72283832d
commit
2938d92a35
20
src/test/compile-fail/pub-struct-field-span-26083.rs
Normal file
20
src/test/compile-fail/pub-struct-field-span-26083.rs
Normal file
@ -0,0 +1,20 @@
|
||||
// Regression test for issue #26083
|
||||
// Test that span for public struct fields start at `pub` instead of the identifier
|
||||
|
||||
struct Foo {
|
||||
pub bar: u8,
|
||||
|
||||
pub
|
||||
//~^ error: field `bar` is already declared [E0124]
|
||||
bar: u8,
|
||||
|
||||
pub bar:
|
||||
//~^ error: field `bar` is already declared [E0124]
|
||||
u8,
|
||||
|
||||
bar:
|
||||
//~^ error: field `bar` is already declared [E0124]
|
||||
u8,
|
||||
}
|
||||
|
||||
fn main() { }
|
Loading…
x
Reference in New Issue
Block a user