fix borrowed props with temp values
This commit is contained in:
1 parent
bdfb3b6285
commit
d559fdaeab
4 files changed
+40
-1
No files matched your search
@@ -79,4 +79,5 @@ pub fn fc_to_builder<'a, T: Properties + 'a>(_: fn(Scope<'a, T>) -> Element<'a>)
|
||||
fn unsafe_props_fail() {
|
||||
let t = trybuild::TestCases::new();
|
||||
t.compile_fail("compile_tests/props_safety.rs");
|
||||
t.compile_fail("compile_tests/props_safety_temporary_values.rs");
|
||||
}
|
||||
@@ -424,7 +424,9 @@ impl<'src> ScopeState {
|
||||
fn_name: &'static str,
|
||||
) -> DynamicNode<'src>
|
||||
where
|
||||
P: Properties + 'child,
|
||||
// The properties must be valid until the next bump frame
|
||||
P: Properties + 'src,
|
||||
// The current bump allocator frame must outlive the child's borrowed props
|
||||
'src: 'child,
|
||||
{
|
||||
let vcomp = VProps::new(component, P::memoize, props);
|
||||
|
||||
Reference in new issue
Block a user