Y
Hacker News
new
|
ask
|
show
|
jobs
by
kobebrookskC3
114 days ago
yes, but the code inside is unsafe. the pin macro is like a safe function.
1 comments
steveklabnik
114 days ago
I'm not sure what that has to do with anything. The macro isn't what makes it safe. The unsafe code being properly written is.
link
kobebrookskC3
113 days ago
but without macros, how would you expose a safe interface?
fn pin(x: T) -> Pin<&mut T> { ... }
would move the value
link
Philpax
113 days ago
Your macroless variant of Rust would offer a safe builtin that does this. It doesn't
need
to be implemented with a macro.
link