A shame that it cannot happen though, would make it slightly less verbose to read. (Which well, is both a good and bad thing depending on how you look at it.)
Yeah, exactly. There are a bunch of places where it wouldn't be an issue, but things like Foo { a: "hello" } actually allocating-and-copying the &str into a String is something that people generally don't want to happen.
Maybe we'll one day get some sort of sufficiently-restricted into-like thing that people wouldn't be worried about it applying even in strict literals, but right now it does way too much complicated stuff, even just in std impls.
I'd like some sort of .into() esque syntax to exist for structs, where you have to explicitly opt in to the conversion, but it is hidden away from creating new ones. Maybe like serde's field attributes for renaming and whatnot.
Its not a perfect solution, but IMO it could be a compromise if you ignore whatever issues I'm glossing over.
It's not even a good one. It's even worse than just always doing the conversion implicitly, because now you have to look up the definition of the struct in order to know whether it behaves funnily.
Writing .into() shouldn't be considered a burden. Seriously, it's 7 characters, and it saves the programmer from having to look up stuff constantly (as well as preventing syntactic bloat in the language). We read code a lot more than we write it, so optimizing for writing fast at the expense of providing important context while reading is an inappropriate trade-off.
That's the approach C++ took and now people have issues where an implicitly called copy/conversion constructor causes loads of hidden code to be run.
Often accepting an impl Into<Foo> argument is the least obtrusive way of letting the caller have implicit conversions while still keeping them visible.