-
Notifications
You must be signed in to change notification settings - Fork 13.3k
remove find_map_relevant_impl
#108895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oh hi, I wrote that rustdoc code 😆
What does it mean for multiple impls to be applicable? Like different generic arguments for the same generic type? That should be ok - rustdoc is just checking if these functions exist at all for the unsubstituted ty, not whether they can actually be called. e.g. it's ok for it to have a false positive on |
(hate mobile GitHub 😠 ) |
@rustbot claim This looks fun! |
@vincenzopalazzo are you working on this? I think I'd like to finish this unless you've already put a lot of time into this. |
@compiler-errors Sorry I did not have time, so take it. Can you cc me on the PR when it is out I would like to see the code 😄 |
…levant_impl, r=b-naber Remove `find_map_relevant_impl` Fixes rust-lang#108895
…levant_impl, r=b-naber Remove `find_map_relevant_impl` Fixes rust-lang#108895
…levant_impl, r=b-naber Remove `find_map_relevant_impl` Fixes rust-lang#108895
…levant_impl, r=b-naber Remove `find_map_relevant_impl` Fixes rust-lang#108895
…levant_impl, r=b-naber Remove `find_map_relevant_impl` Fixes rust-lang#108895
rust/compiler/rustc_middle/src/ty/trait_def.rs
Lines 153 to 158 in 9b60e6c
This function iterates over all impls which may apply to
self_ty
and returns the firstSome
. Note that just because an impl is given tof
it may not actually apply to the wholetrait_ref
(or deeply matchesself_ty
). Because of this it ends up being very easy to misuse. Let's go through a few incorrect uses of this function:rust/src/librustdoc/passes/collect_intra_doc_links.rs
Lines 738 to 763 in 9b60e6c
only looks at the first maybe applicable impl even if there are multiple, idk how exactly that function is used, but it should be wrong 😅
rust/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Lines 2195 to 2197 in 9b60e6c
Checks whether another trait with the same path has an impl for
self_ty
. Note that this emits the error message if 2 versions of a crate are used, but the substs implement neither of the traits.rust/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Line 1818 in 9b60e6c
whatever this is doing 😅 but this should be usable to point to an impl which doesn't actually apply.
I would like to change all the uses of
find_map_relevant_impl
to instead usefor_each_relevant_impl
.The text was updated successfully, but these errors were encountered: