Skip to content
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

make find_similar_impl_candidates even fuzzier #93298

Merged
merged 4 commits into from
Feb 14, 2022
Merged

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Jan 25, 2022

continues the good work of @BGR360 in #92223. I might have overshot a bit and we're now slightly too fuzzy 😅

with this we can now also simplify simplify_type, which is nice :3

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 25, 2022
@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 25, 2022
@cjgillot
Copy link
Contributor

Marking as blocked on #92223.

@cjgillot cjgillot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 28, 2022
@lcnr lcnr assigned cjgillot and unassigned cjgillot Jan 28, 2022
@lcnr lcnr added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jan 28, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jan 28, 2022

😅 the issue was that @BGR360 doesn't have the capacity to finish #92223, so this PR is the only one which should get merged.

should probably have used a clearer wording here

@bors
Copy link
Contributor

bors commented Jan 31, 2022

☔ The latest upstream changes (presumably #93348) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr lcnr force-pushed the issue-92113 branch 2 times, most recently from baa625a to fe076e2 Compare February 1, 2022 12:43
Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the simplification of the logic. However, I feel the compiler now emits too many low-relevance suggestions, for instance integer types. Is there a way to filter them out?

src/test/ui/kindck/kindck-copy.stderr Show resolved Hide resolved
src/test/ui/kindck/kindck-copy.stderr Outdated Show resolved Hide resolved
src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr Outdated Show resolved Hide resolved
ty::Adt(adt, ..) => match adt.adt_kind() {
AdtKind::Struct => Some(15),
AdtKind::Union => Some(16),
AdtKind::Enum => Some(17),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why merge struct/enum/union categories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because for adts we always compare their AdtDef anyways, so giving the different kinds different categories doesn't matter


None
})
.collect()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to collect, or can we return an impl Iterator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would need rpitit for this, as find_similar_impl_candidates is defined on InferCtxt using an extension trait

@bors
Copy link
Contributor

bors commented Feb 8, 2022

☔ The latest upstream changes (presumably #92007) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 9, 2022
@lcnr lcnr force-pushed the issue-92113 branch 2 times, most recently from 0b96439 to 8b31c73 Compare February 11, 2022 16:18
@lcnr
Copy link
Contributor Author

lcnr commented Feb 11, 2022

not 100% happy with which impls are suggested here, but efficiently fixing that probably needs a more general rework of this code which i don't have the capacity for rn

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor

not 100% happy with which impls are suggested here, but efficiently fixing that probably needs a more general rework of this code which i don't have the capacity for rn

So let's go with this first step.
r=me after a rebase.

@bors
Copy link
Contributor

bors commented Feb 11, 2022

☔ The latest upstream changes (presumably #93893) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr
Copy link
Contributor Author

lcnr commented Feb 14, 2022

@bors r=cjgillot rollup

@bors
Copy link
Contributor

bors commented Feb 14, 2022

📌 Commit f2aea1e has been approved by cjgillot

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 14, 2022
@bors
Copy link
Contributor

bors commented Feb 14, 2022

⌛ Testing commit f2aea1e with merge e9ec070cc26027bcae2069663baaa1b027407c1b...

@rust-log-analyzer
Copy link
Collaborator

The job arm-android failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test fs::tests::read_large_dir ... ok

failures:

---- sys::unix::kernel_copy::tests::bench_file_to_socket_copy stdout ----
thread 'sys::unix::kernel_copy::tests::bench_file_to_socket_copy' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Uncategorized, error: "failed to lookup address information: No address associated with hostname" }', library/std/src/sys/unix/kernel_copy/tests.rs:130:69

failures:
    sys::unix::kernel_copy::tests::bench_file_to_socket_copy


test result: FAILED. 931 passed; 1 failed; 4 ignored; 0 measured; 0 filtered out; finished in 952.69s

error: test failed, to rerun pass '-p std --lib'

@bors
Copy link
Contributor

bors commented Feb 14, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 14, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Feb 14, 2022

seems spurious

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 14, 2022
@bors
Copy link
Contributor

bors commented Feb 14, 2022

⌛ Testing commit f2aea1e with merge 52dd59e...

@bors
Copy link
Contributor

bors commented Feb 14, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 52dd59e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 14, 2022
@bors bors merged commit 52dd59e into rust-lang:master Feb 14, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 14, 2022
@lcnr lcnr deleted the issue-92113 branch February 14, 2022 17:11
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (52dd59e): comparison url.

Summary: This benchmark run shows 2 relevant improvements 🎉 but 6 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 0.7%
  • Average relevant improvement: -0.3%
  • Largest improvement in instruction counts: -0.3% on full builds of inflate check
  • Largest regression in instruction counts: 0.8% on full builds of keccak check

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@rustbot rustbot added the perf-regression Performance regression. label Feb 14, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Feb 15, 2022

how does this change perf? :o bit confused by the results.

keccak check, full has a 0.78% regression but its detailed data shows that it is 2.0% faster? https://perf.rust-lang.org/detailed-query.html?commit=52dd59ed2154f4158ae37e6994b678a6249a7bb0&base_commit=b321742c6c27494897a88cd5ac17ac20aa3469a1&benchmark=keccak-check&scenario=full

Maybe simplify_type can now get inlined in some places? All other changes should have only impacted error reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants