From 3311408f8fc4844e857708bf2a222c939ac1066d Mon Sep 17 00:00:00 2001 From: Niklas <71767810+niklass-l@users.noreply.github.com> Date: Sun, 26 May 2024 16:05:00 +0200 Subject: [PATCH] Add visibility to test struct to test compilation and correct macro expansion --- tests/test.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index c47012c..95a27b1 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -27,6 +27,7 @@ fn test_unit_struct() { /// A struct with fields. #[derive(new, PartialEq, Debug)] +#[new(visibility = "pub(crate)")] pub struct Bar { pub x: i32, pub y: String, @@ -170,7 +171,6 @@ fn test_struct_with_defaults() { pub z: T, } - let x = Waldo::>::new(42); assert_eq!( x, @@ -227,7 +227,6 @@ fn test_struct_mixed_defaults() { ); } - #[cfg(feature = "std")] #[test] fn test_struct_phantom_data() { @@ -326,8 +325,8 @@ fn test_enum_unit_variants() { #[cfg(feature = "std")] #[test] fn test_more_involved_enum() { - use std::marker::PhantomData; use std::default::Default; + use std::marker::PhantomData; /// A more involved enum #[derive(new, PartialEq, Debug)]