Check that trait is exported or public before adding hint
Closes #62194.
This PR checks the `AccessLevels` of a trait to check whether adding the intercrate ambiguity hint is valid or not.
I am unsure of both the use of `.unwrap()` as well as removing hints for [downstream *and* [upstream](https://github.com/rust-lang/rust/blob/
92b0f52584c9375505ecdefdd7855b93a5919d51/src/librustc/traits/select.rs#L112-L142).