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

Remove a bunch of redundant args from report_method_error #125906

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

compiler-errors
Copy link
Member

Rebased on top of #125397 because I had originally asked there (#125397 (comment)) for this change to be made, but I just chose to do it myself.

r? fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 3, 2024
@compiler-errors compiler-errors changed the title Simplify method error args Remove a bunch of redundant args from report_method_error Jun 3, 2024
expected: Expectation<'tcx>,
trait_missing_method: bool,
) -> Option<Diag<'_>> {
let (span, sugg_span, source, item_name, args) = match self.tcx.hir_node(call_id) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't ask me what the difference is between span and sugg_span, because it's incredibly nasty how both of those spans are being passed around below and I don't particularly want to simplify it.

@@ -52,7 +52,7 @@ error[E0599]: no function or associated item named `bitor` found for trait objec
LL | let g = BitXor::bitor;
| ^^^^^ function or associated item not found in `dyn BitXor<_>`
|
help: there is a method `bitxor` with a similar name, but with different arguments
help: there is a method `bitxor` with a similar name
Copy link
Member Author

Choose a reason for hiding this comment

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

We were previously passing Some([]) for the args for all raw path exprs, I believe. This lead to the diagnostics code to treat it as if it had no methods.

This expression has no arguments, so "but with different arguments" was spurious.

@@ -15,13 +15,6 @@ LL | Box::z
LL | mac!();
| ------ in this macro invocation
|
note: if you're trying to build a new `Box<_, _>` consider using one of the following associated functions:
Copy link
Member Author

Choose a reason for hiding this comment

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

See above. We don't suggest builder methods for non-calls.

help: trait `B` which provides `B` is implemented but not in scope; perhaps you want to import it
|
LL + use assoc_const::B;
|
help: there is a method `b` with a similar name
|
LL | S::b;
Copy link
Member Author

Choose a reason for hiding this comment

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

See above, we don't do an identifier suggestion if it's not a method.

@bors
Copy link
Contributor

bors commented Jun 3, 2024

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

@compiler-errors compiler-errors force-pushed the simplify-method-error-args branch from bb97add to e9957b9 Compare June 4, 2024 00:29
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Thanks!

@fmease
Copy link
Member

fmease commented Jun 5, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 5, 2024

📌 Commit e9957b9 has been approved by fmease

It is now in the queue for this repository.

@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 Jun 5, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
…kingjubilee

Rollup of 12 pull requests

Successful merges:

 - rust-lang#123168 (Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude)
 - rust-lang#125273 (bootstrap: implement new feature `bootstrap-self-test`)
 - rust-lang#125683 (Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format)
 - rust-lang#125815 (`rustc_parse` top-level cleanups)
 - rust-lang#125903 (rustc_span: Inline some hot functions)
 - rust-lang#125906 (Remove a bunch of redundant args from `report_method_error`)
 - rust-lang#125920 (Allow static mut definitions with #[linkage])
 - rust-lang#125982 (Make deleting on LinkedList aware of the allocator)
 - rust-lang#125995 (Use inline const blocks to create arrays of `MaybeUninit`.)
 - rust-lang#125996 (Closures are recursively reachable)
 - rust-lang#126003 (Add a co-maintainer for the two ARMv4T targets)
 - rust-lang#126004 (Add another test for hidden types capturing lifetimes that outlive but arent mentioned in substs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 78d9a7e into rust-lang:master Jun 5, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone Jun 5, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
Rollup merge of rust-lang#125906 - compiler-errors:simplify-method-error-args, r=fmease

Remove a bunch of redundant args from `report_method_error`

Rebased on top of rust-lang#125397 because I had originally asked there (rust-lang#125397 (comment)) for this change to be made, but I just chose to do it myself.

r? fmease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants