This commit is contained in:
Justin Starry 2019-09-22 09:15:41 -10:00
parent 16c7864d63
commit f8d07237cc
2 changed files with 19 additions and 1 deletions

View File

@ -65,7 +65,7 @@ impl ToTokens for PropsBuilder<'_> {
#[doc(hidden)] #[doc(hidden)]
#vis struct #builder_name#step_generics #vis struct #builder_name#step_generics
#where_clause #where_clause
{ {
wrapped: ::std::boxed::Box<#wrapper_name#ty_generics>, wrapped: ::std::boxed::Box<#wrapper_name#ty_generics>,
_marker: ::std::marker::PhantomData<#step_generic_param>, _marker: ::std::marker::PhantomData<#step_generic_param>,

View File

@ -83,4 +83,22 @@ mod t5 {
} }
} }
mod t6 {
use super::*;
use std::str::FromStr;
#[derive(Properties, Clone)]
pub struct Props<T: FromStr + Clone>
where
<T as FromStr>::Err: Clone,
{
#[props(required)]
value: Result<T, <T as FromStr>::Err>,
}
fn required_prop_generics_with_where_clause_should_work() {
Props::<String>::builder().value(Ok(String::from(""))).build();
}
}
fn main() {} fn main() {}