Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make create_ref only allow T: 'static #519

Merged
merged 6 commits into from
Nov 26, 2022

Conversation

lukechu10
Copy link
Member

@lukechu10 lukechu10 commented Oct 30, 2022

Fixes #494

Closes #400 (basically makes the code pattern impossible)

This essentially makes create_ref only work on 'static types which completely prevents the issue mentioned in #494.

Unfortunately this makes create_ref much less powerful, but in practice, it seems like this won't be too big of a setback. In fact, none of the examples needed to be modified.

@lukechu10 lukechu10 added C-bug Category: bug, something isn't working BREAKING CHANGE Breaking changes introduced in this PR labels Oct 30, 2022
@lukechu10 lukechu10 added this to the v0.9 milestone Oct 30, 2022
@lukechu10 lukechu10 changed the title Make create_ref only allow T: 'static Make create_ref only allow T: 'static Oct 30, 2022
@codecov
Copy link

codecov bot commented Oct 30, 2022

Codecov Report

Base: 64.69% // Head: 64.60% // Decreases project coverage by -0.08% ⚠️

Coverage data is based on head (b1df775) compared to base (de737e5).
Patch coverage: 63.49% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #519      +/-   ##
==========================================
- Coverage   64.69%   64.60%   -0.09%     
==========================================
  Files          52       52              
  Lines        8537     8533       -4     
==========================================
- Hits         5523     5513      -10     
- Misses       3014     3020       +6     
Impacted Files Coverage Δ
packages/sycamore-router/src/router.rs 27.88% <0.00%> (ø)
packages/sycamore/src/motion.rs 0.00% <0.00%> (ø)
packages/sycamore-reactive/src/arena.rs 100.00% <100.00%> (ø)
packages/sycamore-reactive/src/effect.rs 99.31% <100.00%> (ø)
packages/sycamore-reactive/src/iter.rs 97.78% <100.00%> (ø)
packages/sycamore-reactive/src/lib.rs 93.65% <100.00%> (-0.60%) ⬇️
packages/sycamore-reactive/src/memo.rs 100.00% <100.00%> (ø)
packages/sycamore-reactive/src/signal.rs 87.30% <100.00%> (+0.34%) ⬆️
packages/sycamore/src/builder.rs 21.66% <100.00%> (ø)
packages/sycamore/src/suspense.rs 94.61% <100.00%> (+0.04%) ⬆️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lukechu10 lukechu10 added performance Performance related and removed performance Performance related labels Oct 30, 2022
@lukechu10 lukechu10 merged commit 9d7af24 into sycamore-rs:master Nov 26, 2022
@lukechu10 lukechu10 deleted the static-arena branch November 26, 2022 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Breaking changes introduced in this PR C-bug Category: bug, something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined Behavior when using Drop with create_ref Lifetime error when using nested signals
1 participant