Closed
Description
(See #4110 and the fix in #12245).
If there are two definitions with the same name and different privacy modifiers in different namespaces, and there is an error on one of them, the error message might use the wrong kind of item name in its description.
E.g., if there is both a trait and function called foo
and the latter is referred to and used, then the error message will still talk about "the trait foo
" even though it is a function.
See the FIXME in privacy.rs.
We might want to do something even better than just fixing this bug - it would be nice if we could make the error messages a bit clearer as to where exactly the error is (which namespace, but not using that terminology). See discussion in #12245.