Actually, there are proposals for implementing a DerefMove (and IndexMove) traits:
So if anything, it seems like . will probably have even more magic behavior in the future (regardless of what happens with await)
The simple fact is that . has always been magic in Rust (and for good reason), this isn't unusual.
And other languages like JavaScript have getters/setters which allow you to run arbitrary code when a property is accessed or set:
class Foo {
get bar() {
console.log("Getting bar");
return 5;
}
set bar(value) {
console.log("Setting bar to", value);
}
}
let x = new Foo();
x.bar;
x.bar = 10;