for<'a, T: ?Sized> &'a T !: DerefMut
Seems like a hunk of unreadable code. Is this valid Rust?https://internals.rust-lang.org/t/unsoundness-in-pin/11311/3...
for<'a, T: ?Sized> &'a T !: DerefMut
Seems like a hunk of unreadable code. Is this valid Rust?https://internals.rust-lang.org/t/unsoundness-in-pin/11311/3...
You’re not wrong to find it illegible; apart from the syntax, that phrase invokes the concepts of lifetimes, mutability, borrowing, and traits, none of which have straightforward semantic analogues in other common languages.
But FWIW they’re primitive concepts in Rust. A typical Rust user wouldn’t read or write code that looks like that very much, but they would know what it means, if that makes any sense.
Edit: Seeing sibling comments about whether this snippet actually parses, I guess I should amend this to say that a typical Rust user has an idea of what it’s supposed to mean :)
It's both a good and bad thing that rust has these sort of deep areas where 95% of users won't ever have to go - Pin being another example. I think it's much more good than bad though.