Skip to content

Commit a7e4725

Browse files
xtask: Improve an error location in check-raw
This fixes a case where `check-raw` can incorrectly report an error as being the first line of a file.
1 parent f9e3bea commit a7e4725

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xtask/src/check_raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn check_fields(fields: &Punctuated<Field, Comma>, src: &Path) -> Result<(), Err
256256
/// Validate a struct.
257257
fn check_struct(item: &ItemStruct, src: &Path) -> Result<(), Error> {
258258
if !is_pub(&item.vis) {
259-
return Err(Error::new(ErrorKind::MissingPub, src, &item.vis));
259+
return Err(Error::new(ErrorKind::MissingPub, src, &item.struct_token));
260260
}
261261

262262
let attrs = parse_attrs(&item.attrs, src)?;

0 commit comments

Comments
 (0)