What are Rust's exact auto-dereferencing rules?
@lebyy▲ 0 net votes
Problem: I'm learning/experimenting with Rust, and in all the elegance that I find in this language, there is one peculiarity that baffles me and seems totally out of place. Rust automatically dereferences pointers when making method calls. I made some tests to… Fix (from the top answer): Your pseudo-code is pretty much correct. For this example, suppose we had a method call foo.bar() where foo: T . I'm going to use the fully qualified syntax (FQS) to be unambiguous about what type the method is being called with, e.g. A::bar(foo) or A::bar(&***foo) . I'm just going to write a pile of random capital…