Email or username:

Password:

Forgot your password?
Dani ✨🐚

tired: “error: cannot borrow ‘x’ as mutable more than once at a time”

inspired: “with this reference’s creation, the thread of memory safety is severed. refactor your code to restore the weave of fate, or persist in the doomed world you have created”

20 comments
DELETED

@daniel I see your borrow checker and raise you a reference to the owned object of a unique_ptr.

auto _d = std::make_unique<double>();
auto& d = *_d;

glyn

@daniel Nice, but refactoring, as such, won't help. 😉

Brendan

@daniel You should have seen the messages the runtime used to print when it crashed, haha.

Joshua Barretto

@brendan @daniel I'm just old (in Rust years) enough to remember those, they were great! Very sad they've gone :(

Brendan

@jsbarretto @daniel Yeah! They added some personality… but understand why they were removed. Kind of wish they were kept for something though… maybe for ICEs perhaps?

Funnily enough dune has issued me an ominous quote once or twice recently (on some internal errors), so I guess the spirit lives on!

Dani ✨🐚

“there are only ten people on Mastodon so you are trapped in a little bubble” theory proven incorrect when this silly post outperforms every tweet I ever tweeted

Dani ✨🐚

can’t believe this one is *still* going 😅

Aires

@daniel
:blobfoxfacepalm: : drinking beer because your code doesn't work

:blobfoxdrakelike: : drinking sujamma so you can brute force your code into working

Eli the Bearded

@daniel Fediverse search sucks so I won't link to it, but @retr0id had the perfect "checkmate borrow checker" "fix": open and operate on /proc/self/mem

Jordan

@daniel @hikari Clearly taking multiple mutable borrows should fork the program to preserve the necessary exclusion, a la Threaded INTERCAL.

Patrick Chieppe

@daniel brb, writing a programming game where you're a wizard and all error messages are like this

Joe Thompson

@daniel

“Be this reference created ever,
the thread of safety thou shalt sever. Mend thy code to re-weave fate,
or thy code’s doom shalt thou create.”

KevinOfComputer

@daniel Rust _and_ Morrowind? That's a follow.

takin' a break

@daniel thank you for making this post it fixed me

Go Up