From 91d0b371ef2b7a6cdca5f723ba96b6fbfd08ca4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 22 Feb 2024 18:38:10 +0000 Subject: [PATCH] Fix rebase --- compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs | 2 +- compiler/rustc_hir_typeck/src/method/suggest.rs | 4 ++-- tests/ui/impl-trait/where-allowed.stderr | 2 ++ tests/ui/ufcs/bad-builder.stderr | 9 +++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 3b0baee7180..4bc86435482 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -562,7 +562,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { None }; - let suggest_confusable = |err: &mut Diagnostic| { + let suggest_confusable = |err: &mut DiagnosticBuilder<'_>| { let Some(call_name) = call_ident else { return; }; diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index aa6817002b8..babdbce0005 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -1418,7 +1418,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { fn find_likely_intended_associated_item( &self, - err: &mut Diagnostic, + err: &mut DiagnosticBuilder<'_>, similar_candidate: ty::AssocItem, span: Span, args: Option<&'tcx [hir::Expr<'tcx>]>, @@ -1496,7 +1496,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pub(crate) fn confusable_method_name( &self, - err: &mut Diagnostic, + err: &mut DiagnosticBuilder<'_>, rcvr_ty: Ty<'tcx>, item_name: Ident, call_args: Option>>, diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr index f203f4cabc8..c4bdd484fdb 100644 --- a/tests/ui/impl-trait/where-allowed.stderr +++ b/tests/ui/impl-trait/where-allowed.stderr @@ -395,6 +395,8 @@ error[E0599]: no function or associated item named `into_vec` found for slice `[ LL | vec![vec![0; 10], vec![12; 7], vec![8; 3]] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `[_]` | +help: there is an associated function `to_vec` with a similar name + --> $SRC_DIR/alloc/src/slice.rs:LL:COL = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0053]: method `in_trait_impl_return` has an incompatible type for trait diff --git a/tests/ui/ufcs/bad-builder.stderr b/tests/ui/ufcs/bad-builder.stderr index 7fa47c82de2..e1c5e45b3eb 100644 --- a/tests/ui/ufcs/bad-builder.stderr +++ b/tests/ui/ufcs/bad-builder.stderr @@ -2,10 +2,7 @@ error[E0599]: no function or associated item named `mew` found for struct `Vec $DIR/bad-builder.rs:2:15 | LL | Vec::::mew() - | ^^^ - | | - | function or associated item not found in `Vec` - | help: there is an associated function with a similar name: `new` + | ^^^ function or associated item not found in `Vec` | note: if you're trying to build a new `Vec` consider using one of the following associated functions: Vec::::new @@ -14,6 +11,10 @@ note: if you're trying to build a new `Vec` consider using one of the followi Vec::::new_in and 2 others --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL +help: there is an associated function `new` with a similar name + | +LL | Vec::::new() + | ~~~ error: aborting due to 1 previous error