this code compiles and runs without panicking
thanks to @asokol123 for bringing it
original tweet by @m_ou_se
code on playground
relevant RFC with rationale for this design decision
thanks to @asokol123 for bringing it
original tweet by @m_ou_se
code on playground
relevant RFC with rationale for this design decision
how
AFAIK there’s no better way to do it
syn code
internal representation of a Literal
IRLO thread
syn
parses Rust literals (which are already parsed inside of proc_macro
)AFAIK there’s no better way to do it
syn code
internal representation of a Literal
IRLO thread
reversal of control to prevent boxing in object-safe traits
playground
playground
kinda obvious in retrospect
playground
there’s one deref missing and the whole Box gets coerced to dyn Any
playground
rules for temporary lifetime extension are syntactic, not semantic
playground
about temporary lifetimes
playground
about temporary lifetimes
so, a quick PSA moment
The Rust Foundation (not to be confused with The Rust Project, who actually develop Rust) is currently planning to put up trademark policies that are so restrictive that this channel would be affected. essentially, they want to prohibit usage of the word “Rust” in names of any projects, including non-commercial. (they also banned a bunch of stuff like modifying Rust logo and selling Rust merch).
that’s kinda awful. if you also find this policy kinda awful, please, express your disagreement in the feedback form. as far as I understand, it would be open for a week.
sorry for offtop & pinning, I hope that won’t happen again.
The Rust Foundation (not to be confused with The Rust Project, who actually develop Rust) is currently planning to put up trademark policies that are so restrictive that this channel would be affected. essentially, they want to prohibit usage of the word “Rust” in names of any projects, including non-commercial. (they also banned a bunch of stuff like modifying Rust logo and selling Rust merch).
that’s kinda awful. if you also find this policy kinda awful, please, express your disagreement in the feedback form. as far as I understand, it would be open for a week.
sorry for offtop & pinning, I hope that won’t happen again.
Awful Rust snippets for fun and profit pinned «so, a quick PSA moment The Rust Foundation (not to be confused with The Rust Project, who actually develop Rust) is currently planning to put up trademark policies that are so restrictive that this channel would be affected. essentially, they want to prohibit…»
Awful Rust snippets for fun and profit
and the workaround playground
I wrote a longish post about this one since snippet alone doesn’t explain it well
Post: deref specialization in const contexts
Post: deref specialization in const contexts