Skip to content

Commit 7df4b0b

Browse files
committed
Rebase and update test
1 parent 7e38c8a commit 7df4b0b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_hir_typeck/src/method/suggest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
399399
if static_candidates.len() == 1 {
400400
let mut has_unsuggestable_args = false;
401401
let ty_str = if let Some(CandidateSource::Impl(impl_did)) =
402-
static_candidates.get(0)
402+
static_candidates.get(0)
403403
{
404404
// When the "method" is resolved through dereferencing, we really want the
405405
// original type that has the associated function for accurate suggestions.
@@ -453,7 +453,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
453453
self.ty_to_value_string(actual.peel_refs())
454454
};
455455
if let SelfSource::MethodCall(_) = source {
456-
let first_arg = if let Some(CandidateSource::Impl(impl_did)) = static_sources.get(0) &&
456+
let first_arg = if let Some(CandidateSource::Impl(impl_did)) = static_candidates.get(0) &&
457457
let Some(assoc) = self.associated_value(*impl_did, item_name) {
458458
let sig = self.tcx.fn_sig(assoc.def_id);
459459
if let Some(first) = sig.inputs().skip_binder().get(0) {

src/test/ui/suggestions/issue-102354.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | fn func() {}
1313
help: use associated function syntax instead
1414
|
1515
LL | i32::func();
16-
| ~~~~~~~~~
16+
| ~~~~~~~~~~~
1717
help: disambiguate the associated function for the candidate
1818
|
1919
LL | <i32 as Trait>::func(x);

0 commit comments

Comments
 (0)