| commit | 89902443e84e405c01ecbd16b8923e758f9c41dd | [log] [tgz] |
|---|---|---|
| author | David Tolnay <dtolnay@gmail.com> | Wed Dec 30 15:10:40 2020 -0800 |
| committer | David Tolnay <dtolnay@gmail.com> | Wed Dec 30 15:17:58 2020 -0800 |
| tree | 159473abd22fa98b2a075e423c5362f6063ff5e7 | |
| parent | 232a0e36302ebb07aa442cda46ea3c18b497b0b1 [diff] [blame] |
Preserve visibility token's span on struct field
diff --git a/macro/src/expand.rs b/macro/src/expand.rs index c063cf3..1944642 100644 --- a/macro/src/expand.rs +++ b/macro/src/expand.rs
@@ -157,7 +157,7 @@ let fields = strct.fields.iter().map(|field| { // This span on the pub makes "private type in public interface" errors // appear in the right place. - let vis = Token); + let vis = field.visibility; quote!(#vis #field) }); let mut derives = None;