Negative interaction between &self, auto-ref, and @T implementations #3585
Labels
A-type-system
Area: Type system
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone
@erickt stumbled across a negative interaction between the current auto-ref/auto-deref rules, explicit self, and implementations for
@T
.If you write code like this:
You get an assertion failure. What happens is that auto-ref derefs the
@uint
touint
and then auto-refs that to&uint
. This is because the current rule is "auto-deref until you can't, then auto-ref". It would be easy enough to make it try auto-refing at each stage. Probably it should, this seems like an important use case. This is a fairly small change tomiddle/typeck/check/method.rs
.The text was updated successfully, but these errors were encountered: