Change #[privatize] into #[derive(DenyPublicFields)]

This commit is contained in:
Anthony Ramine 2017-02-14 17:35:39 +01:00
parent 19c645ff68
commit 8bcf36b9a5
16 changed files with 69 additions and 65 deletions

View file

@ -11,5 +11,6 @@ doctest = false
[dependencies]
compiletest_helper = {path = "../helper"}
deny_public_fields = {path = "../../../components/deny_public_fields"}
plugins = {path = "../../../components/plugins"}
script = {path = "../../../components/script"}

View file

@ -2,14 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(plugin, custom_attribute)]
#![plugin(plugins)]
#![allow(dead_code)]
#[privatize]
#[macro_use]
extern crate deny_public_fields;
#[derive(DenyPublicFields)]
//~^ ERROR custom derive attribute panicked
struct Foo {
pub v1: i32,
//~^ ERROR Field v1 is public where only private fields are allowed
v2: i32
}

View file

@ -3,6 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate compiletest_helper;
#[macro_use]
extern crate deny_public_fields;
#[test]
fn compile_test() {