4 ms·
`putc` is not a function provided by Rust; it appears nowhere in the Rust compiler or standard library. And as dbaupp has mentioned, the ~ operator is being rep
by kibwen 13y ago
`putc` is not a function provided by Rust; it appears nowhere in the Rust compiler or standard library. And as dbaupp has mentioned, the ~ operator is being replaced with the `box` keyword.
(Further historical note: the choice of ~ as the operator to create owned pointers is hardly "random": it's a line, and owned pointers are linear types. Contrast the obsolete @ operator for creating managed pointers, which is a circle because managed pointers were primarily used to facilitate circular references. The removal of @ means that this conceptual mapping is no longer evident, hence the transition to the `box` keyword.)