Repository navigation
Improve collapsed suggestions for trait impls tuples - #164156
rust-bors[bot] merged 1 commit into
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Otherwise I can test |
c03716e to
c4da207
Compare
|
@mejrs in case you're interested, as you reviewed the original feature. |
|
Thanks for working on this ❤️ I did give this branch a try against diesel's compile tests and that are the changes compared to a nightly run from like 2 weeks ago. diesel-rs/diesel@94149ed That means this likely includes changes not caused by this PR. You can still see that it works at least in one location: diesel-rs/diesel@94149ed#diff-b132b9a5ac7fd8f0b0c56b37497ffdde41c80139f1d4c4658fd7a52e2acdb52aR16-R17 diesel-rs/diesel@94149ed#diff-066d6de06c3ce8831c3761df40958cc6ab35dfdc514de934d46fd8a87248fd2eL301-R309 might be an interesting target for this as well. The tuple is a type argument there, not the type implementing the trait. I still think that would be another location to apply this kind of unification. (I'm unsure why it completely disappeared there, might be related to trait solver changes) |
Mhhhh, interesting, thanks for the feedback ! I can trigger a build (+ tests) locally on my side with a stage1 compiler from my branch. It should be feasible . I can still compare my branch with and without the HEAD commit, and see the differences. |
|
If you would like to run the diesel compile tests yourself you can will need the following steps:
|
Thanks for the details ! On my side, I have tested
Then, I have searched over the remaining tests in that sounds good. |
|
@rustbot reroll |
c4da207 to
e1ea606
Compare
This comment has been minimized.
This comment has been minimized.
Currently this collapsed output only works when all the candidates implement the same trait and are continious over their arity by step of 1. Sometimes we might find candidates that do not all implement the same trait but which contains subsets of continious tuples all implementing the same trait.
e1ea606 to
8b24bbd
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I have fixed what you suggested. I have simplified the code to get rid of indices. The code should be more idiomatic, we still rely on ranges because we use |
| let mut last_tuple_trait_ref = None; | ||
|
|
||
| fn have_same_trait_path(a: &TraitRef<'_>, b: &TraitRef<'_>) -> bool { | ||
| a.print_only_trait_path().to_string() == b.print_only_trait_path().to_string() |
There was a problem hiding this comment.
This is not ideal, but lets roll with it for now. It'd be better to compare the DefId and args of the trait itself.
There was a problem hiding this comment.
I can fix it in another PR, if you want.
|
@bors r+ |
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…uwer Rollup of 24 pull requests Successful merges: - #165819 (Avoid redundant scans when extracting stage0 archives) - #166011 (Clean revert of recent `String::retain` changes) - #159805 (Implemented different with_native_path conversion methods, refactoring fs functions to utilize with_native_path, and move exists to use with_native_path) - #162414 (Make min/max and copysign intrinsics generic) - #163891 (Do not include context span when source is unavailable to render) - #164156 (Improve collapsed suggestions for trait impls tuples) - #165900 ([tiny] Tweak wording of missing `core` note) - #165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - #165979 (Improve index inference diagnostics) - #165983 (Update `minifier-rs` dependency version to `0.5.0`) - #165999 (Update TPDE submodule) - #166005 (add ABI compat checks for new float types) - #165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - #165792 (prevent optimization for input in ascii benchmarks) - #165936 (Enhance documentation for try_clone File implementation) - #165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - #165941 (Merge `type_bf16()` with `type_f16b()`) - #165942 (windows: use io::const_error in get_access_mode) - #165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - #165956 (Document wide pointers in core::ptr module) - #165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - #165993 (pipe_subprocess test: use libtest harness) - #165996 (Fix(docs): Correct discard behavior in datagram peek docs) - #165998 (Cleanup borrowck)
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes rust-lang#163641 On my side the use cases contained in rust-lang#163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…uwer Rollup of 18 pull requests Successful merges: - #166039 (`rust-analyzer` subtree update) - #165819 (Avoid redundant scans when extracting stage0 archives) - #157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - #162414 (Make min/max and copysign intrinsics generic) - #163891 (Do not include context span when source is unavailable to render) - #164156 (Improve collapsed suggestions for trait impls tuples) - #165900 ([tiny] Tweak wording of missing `core` note) - #165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - #165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - #165792 (prevent optimization for input in ascii benchmarks) - #165936 (Enhance documentation for try_clone File implementation) - #165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - #165941 (Merge `type_bf16()` with `type_f16b()`) - #165942 (windows: use io::const_error in get_access_mode) - #165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - #165956 (Document wide pointers in core::ptr module) - #165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - #165996 (Fix(docs): Correct discard behavior in datagram peek docs)
…uwer Rollup of 18 pull requests Successful merges: - #166039 (`rust-analyzer` subtree update) - #165819 (Avoid redundant scans when extracting stage0 archives) - #157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - #162414 (Make min/max and copysign intrinsics generic) - #163891 (Do not include context span when source is unavailable to render) - #164156 (Improve collapsed suggestions for trait impls tuples) - #165900 ([tiny] Tweak wording of missing `core` note) - #165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - #165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - #165792 (prevent optimization for input in ascii benchmarks) - #165936 (Enhance documentation for try_clone File implementation) - #165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - #165941 (Merge `type_bf16()` with `type_f16b()`) - #165942 (windows: use io::const_error in get_access_mode) - #165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - #165956 (Document wide pointers in core::ptr module) - #165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - #165996 (Fix(docs): Correct discard behavior in datagram peek docs)
…uwer Rollup of 18 pull requests Successful merges: - #166039 (`rust-analyzer` subtree update) - #165819 (Avoid redundant scans when extracting stage0 archives) - #157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - #162414 (Make min/max and copysign intrinsics generic) - #163891 (Do not include context span when source is unavailable to render) - #164156 (Improve collapsed suggestions for trait impls tuples) - #165900 ([tiny] Tweak wording of missing `core` note) - #165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - #165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - #165792 (prevent optimization for input in ascii benchmarks) - #165936 (Enhance documentation for try_clone File implementation) - #165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - #165941 (Merge `type_bf16()` with `type_f16b()`) - #165942 (windows: use io::const_error in get_access_mode) - #165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - #165956 (Document wide pointers in core::ptr module) - #165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - #165996 (Fix(docs): Correct discard behavior in datagram peek docs)
Rollup merge of #164156 - rperier:fix_better_suggestions_for_trait_impls_tuples, r=estebank Improve collapsed suggestions for trait impls tuples Fixes #163641 On my side the use cases contained in #163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too. No LLM, entirely written and tested by myself.
…uwer Rollup of 18 pull requests Successful merges: - rust-lang/rust#166039 (`rust-analyzer` subtree update) - rust-lang/rust#165819 (Avoid redundant scans when extracting stage0 archives) - rust-lang/rust#157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - rust-lang/rust#162414 (Make min/max and copysign intrinsics generic) - rust-lang/rust#163891 (Do not include context span when source is unavailable to render) - rust-lang/rust#164156 (Improve collapsed suggestions for trait impls tuples) - rust-lang/rust#165900 ([tiny] Tweak wording of missing `core` note) - rust-lang/rust#165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - rust-lang/rust#165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - rust-lang/rust#165792 (prevent optimization for input in ascii benchmarks) - rust-lang/rust#165936 (Enhance documentation for try_clone File implementation) - rust-lang/rust#165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - rust-lang/rust#165941 (Merge `type_bf16()` with `type_f16b()`) - rust-lang/rust#165942 (windows: use io::const_error in get_access_mode) - rust-lang/rust#165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - rust-lang/rust#165956 (Document wide pointers in core::ptr module) - rust-lang/rust#165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - rust-lang/rust#165996 (Fix(docs): Correct discard behavior in datagram peek docs)
…nathanBrouwer Rollup of 18 pull requests Successful merges: - rust-lang#166039 (`rust-analyzer` subtree update) - rust-lang#165819 (Avoid redundant scans when extracting stage0 archives) - rust-lang#157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - rust-lang#162414 (Make min/max and copysign intrinsics generic) - rust-lang#163891 (Do not include context span when source is unavailable to render) - rust-lang#164156 (Improve collapsed suggestions for trait impls tuples) - rust-lang#165900 ([tiny] Tweak wording of missing `core` note) - rust-lang#165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - rust-lang#165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - rust-lang#165792 (prevent optimization for input in ascii benchmarks) - rust-lang#165936 (Enhance documentation for try_clone File implementation) - rust-lang#165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - rust-lang#165941 (Merge `type_bf16()` with `type_f16b()`) - rust-lang#165942 (windows: use io::const_error in get_access_mode) - rust-lang#165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - rust-lang#165956 (Document wide pointers in core::ptr module) - rust-lang#165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - rust-lang#165996 (Fix(docs): Correct discard behavior in datagram peek docs)
…uwer Rollup of 18 pull requests Successful merges: - rust-lang/rust#166039 (`rust-analyzer` subtree update) - rust-lang/rust#165819 (Avoid redundant scans when extracting stage0 archives) - rust-lang/rust#157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - rust-lang/rust#162414 (Make min/max and copysign intrinsics generic) - rust-lang/rust#163891 (Do not include context span when source is unavailable to render) - rust-lang/rust#164156 (Improve collapsed suggestions for trait impls tuples) - rust-lang/rust#165900 ([tiny] Tweak wording of missing `core` note) - rust-lang/rust#165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - rust-lang/rust#165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - rust-lang/rust#165792 (prevent optimization for input in ascii benchmarks) - rust-lang/rust#165936 (Enhance documentation for try_clone File implementation) - rust-lang/rust#165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - rust-lang/rust#165941 (Merge `type_bf16()` with `type_f16b()`) - rust-lang/rust#165942 (windows: use io::const_error in get_access_mode) - rust-lang/rust#165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - rust-lang/rust#165956 (Document wide pointers in core::ptr module) - rust-lang/rust#165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - rust-lang/rust#165996 (Fix(docs): Correct discard behavior in datagram peek docs)
…uwer Rollup of 18 pull requests Successful merges: - rust-lang/rust#166039 (`rust-analyzer` subtree update) - rust-lang/rust#165819 (Avoid redundant scans when extracting stage0 archives) - rust-lang/rust#157984 (-Zassumptions-on-binders: Emit new-style region constraints from type relations) - rust-lang/rust#162414 (Make min/max and copysign intrinsics generic) - rust-lang/rust#163891 (Do not include context span when source is unavailable to render) - rust-lang/rust#164156 (Improve collapsed suggestions for trait impls tuples) - rust-lang/rust#165900 ([tiny] Tweak wording of missing `core` note) - rust-lang/rust#165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - rust-lang/rust#165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - rust-lang/rust#165792 (prevent optimization for input in ascii benchmarks) - rust-lang/rust#165936 (Enhance documentation for try_clone File implementation) - rust-lang/rust#165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - rust-lang/rust#165941 (Merge `type_bf16()` with `type_f16b()`) - rust-lang/rust#165942 (windows: use io::const_error in get_access_mode) - rust-lang/rust#165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - rust-lang/rust#165956 (Document wide pointers in core::ptr module) - rust-lang/rust#165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - rust-lang/rust#165996 (Fix(docs): Correct discard behavior in datagram peek docs)
View all comments
Fixes #163641
On my side the use cases contained in #163641 work. Most of the examples in diesel shown in diesel-rs/diesel#5260 should work too.
No LLM, entirely written and tested by myself.