janriemer, to rust

"Can't move a closure into a spawned thread"

https://users.rust-lang.org/t/cant-move-a-closure-into-a-spawned-thread/111332

or phrased differently: "Misunderstandings of what the 'static lifetime in means".

Kornel's excellent answer:
https://users.rust-lang.org/t/cant-move-a-closure-into-a-spawned-thread/111332/8?u=janriemer

"Note that any lifetime bounds, including 'static, apply only to references and types containing references. They do nothing when applied to self-contained types. This means that String is not 'static, but rather it isn't affected by any lifetime bound."

janriemer, to rust

Practical suggestions for building around borrow errors - by quinedot

https://quinedot.github.io/rust-learning/lifetime-intuition.html

If you're struggling with the borrow checker and lifetimes, this is an excellent resource!

In some past toot I've said that Rust lends itself very well to intuition-based learning...

https://floss.social/@janriemer/109415274612140073

...so this learning resource takes the same line (according to its title)! Nice!

ferrous, to rust
@ferrous@social.ferrous-systems.com avatar

🦀 New blog post alert 🦀

"Using mem::take to reduce heap allocations"

This is the first post of a series where we go through the performance work we did in rustls, a modern TLS library in Rust. Today we tame the borrow checker using mem::take.

https://ferrous-systems.com/blog/rustls-borrow-checker-p1/

janriemer,

@ferrous This is one of the best explanations about solving certain borrow checker issues I have ever read!

The part where you explain that &-refs are Copy, but &mut-refs are not, but instead a reborrow happens is mind-blowing! 🤯

Thank you for this excellent blog post!❤️ Every Rustacean should read this!

Very excited for part 2 of the series. :awesome:

janriemer, to rust

Obscure Rust: reborrowing is a half-baked feature - by Thoughts with wings (2022-06)

https://haibane-tenshi.github.io/rust-reborrowing/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • cubers
  • cisconetworking
  • osvaldo12
  • magazineikmin
  • Youngstown
  • thenastyranch
  • rosin
  • slotface
  • Durango
  • mdbf
  • khanakhh
  • megavids
  • tacticalgear
  • InstantRegret
  • normalnudes
  • modclub
  • ngwrru68w68
  • everett
  • GTA5RPClips
  • ethstaker
  • anitta
  • Leos
  • tester
  • provamag3
  • lostlight
  • All magazines