You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
incorrect unstable_name_collision warning for unstable inherent method name #50232
Compiling the code below with nightly produces an unstable_name_collision warning. However the code works after enabling the feature gate, I presume because the unstable method is inherent and takes precedence over trait methods. In this particular case, it can still be worth warning that the behaviour of the standard library method can be different, but the current “warning: once this method is added to the standard library, there will be ambiguity here, which will cause a hard error!” is incorrect.
If the trait method parameters are different from the inherent method parameters, it could end up leading to a hard error for a different reason. For example for the code below, opening the feature gate will cause a hard error, but because of a type mismatch rather than because of ambiguity.
Activity
varkor commentedon Apr 26, 2018
cc @kennytm, as this lint comes from #48552.
kennytm commentedon Apr 26, 2018
What about this?
It seems the message is too long though.
varkor commentedon Apr 26, 2018
Or simply:
(which is even shorter than the original.)
tspiteri commentedon Apr 26, 2018
If the trait method parameters are different from the inherent method parameters, it could end up leading to a hard error for a different reason. For example for the code below, opening the feature gate will cause a hard error, but because of a type mismatch rather than because of ambiguity.
So a more generic error like @varkor suggests is better.