mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Change #[privatize] into #[derive(DenyPublicFields)]
This commit is contained in:
parent
19c645ff68
commit
8bcf36b9a5
16 changed files with 69 additions and 65 deletions
|
@ -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"}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue