deny_public_fields: display field identifier in help message

Use a binding's field identifier to produce more descriptive output.
Fall back to a binding's identifier if a field identifier is not
available.

Additionally, make the privatize.rs compiletest more specific and
wrap the identifier in backticks to aid readability.
This commit is contained in:
Harvey Hunt 2017-06-24 00:21:52 +01:00
parent 946c9aede1
commit 6081241962
2 changed files with 3 additions and 1 deletions

View file

@ -9,6 +9,7 @@ extern crate deny_public_fields;
#[derive(DenyPublicFields)]
//~^ ERROR proc-macro derive panicked
//~| HELP Field `v1` should not be public
struct Foo {
pub v1: i32,
v2: i32