@ManishEarth re: elsa, I get why the indirection of a Box is needed, so that insert() might move the Box but not its contents, but why is an UnsafeCell needed around the HashMap?
-
-
Replying to @mountain_ghosts
It's UB in rust to mutate something when other &T references exist, even if you verify they're not reading between mutations. This requirement is relaxed for mutations poking within UnsafeCell, they "don't count" as mutating the T from the outside.
3 replies 0 retweets 0 likes -
Replying to @ManishEarth
and does UB mean "won't compile" or "the compiler will do something unspecified"
1 reply 0 retweets 1 like -
Replying to @mountain_ghosts
The latter. And it's a stronger statement than implementation-defined, implementation-defined is "unspecified but reasonable", UB is "unspecified and potentially catastrophic"
2 replies 0 retweets 0 likes -
Replying to @ManishEarth
does safe rust have any UB, or is it only unsafe code?
1 reply 0 retweets 1 like -
Replying to @mountain_ghosts
In theory safe rust would not have any UB, that's the main sell. In practice there are ways to trigger UB in safe rust (compiler bugs, etc) These are hard to do by accident though.
1 reply 0 retweets 0 likes -
Replying to @ManishEarth @mountain_ghosts
Unless you use floats. Or is that one fixed now?
1 reply 0 retweets 0 likes -
Replying to @sgrif @mountain_ghosts
Not yet iirc but we hope to. I would categorize that as "compiler bug" but it's easier to trigger (Rarely causes issues though)
1 reply 0 retweets 0 likes
Yeah, having a float larger than u64 is pretty rare to begin with.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.