diff --git a/tests/src/boxed_field.rs b/tests/src/boxed_field.rs new file mode 100644 index 000000000..b41b7735c --- /dev/null +++ b/tests/src/boxed_field.rs @@ -0,0 +1,10 @@ +include!(concat!(env!("OUT_DIR"), "/boxed_field.rs")); + +#[test] +/// Confirm `Foo::bar` is boxed by creating an instance +fn test_bar_is_boxed() { + use alloc::boxed::Box; + let _ = Foo { + bar: Some(Box::new(Bar {})), + }; +} diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 614baa969..473617d18 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -56,6 +56,9 @@ mod submessage_without_package; #[cfg(test)] mod type_names; +#[cfg(test)] +mod boxed_field; + mod test_enum_named_option_value { include!(concat!(env!("OUT_DIR"), "/myenum.optionn.rs")); } @@ -140,10 +143,6 @@ pub mod invalid { } } -pub mod boxed_field { - include!(concat!(env!("OUT_DIR"), "/boxed_field.rs")); -} - pub mod default_string_escape { include!(concat!(env!("OUT_DIR"), "/default_string_escape.rs")); }