Another interesting question that @tschottdorf encountered when implementing default binding modes: What do we do with constants? The RFC specifies that we ought to treat a FOO binding that resolves to a constant as something which can skip through &T types -- however, that runs into trouble if the type of the constant itself is &str or &[T]. The current logic at least skips through all &T or &mut T types when it skips through any, but handling &str correctly would require skipping through "only the right number".
@tschottdorf implemented various rules but we should at minimum update the RFC to match.
Another interesting question that @tschottdorf encountered when implementing default binding modes: What do we do with constants? The RFC specifies that we ought to treat a
FOObinding that resolves to a constant as something which can skip through&Ttypes -- however, that runs into trouble if the type of the constant itself is&stror&[T]. The current logic at least skips through all&Tor&mut Ttypes when it skips through any, but handling&strcorrectly would require skipping through "only the right number".@tschottdorf implemented various rules but we should at minimum update the RFC to match.