-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove a bunch of redundant args from report_method_error
#125906
Conversation
report_method_error
expected: Expectation<'tcx>, | ||
trait_missing_method: bool, | ||
) -> Option<Diag<'_>> { | ||
let (span, sugg_span, source, item_name, args) = match self.tcx.hir_node(call_id) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
☔ The latest upstream changes (presumably #125397) made this pull request unmergeable. Please resolve the merge conflicts. |
bb97add
to
e9957b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@bors r+ rollup |
…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
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
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