about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-02-22 18:38:10 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-02-22 18:38:10 +0000
commit91d0b371ef2b7a6cdca5f723ba96b6fbfd08ca4c (patch)
tree1ec551e5db85317cc4930f21a92e8fb4d410638f
parentd67dcf5a8bb14f6c83f5c86edea0c72835974aa5 (diff)
downloadrust-91d0b371ef2b7a6cdca5f723ba96b6fbfd08ca4c.tar.gz
rust-91d0b371ef2b7a6cdca5f723ba96b6fbfd08ca4c.zip
Fix rebase
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs2
-rw-r--r--compiler/rustc_hir_typeck/src/method/suggest.rs4
-rw-r--r--tests/ui/impl-trait/where-allowed.stderr2
-rw-r--r--tests/ui/ufcs/bad-builder.stderr9
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<Vec<Ty<'tcx>>>,
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<Q
   --> $DIR/bad-builder.rs:2:15
    |
 LL |     Vec::<Q>::mew()
-   |               ^^^
-   |               |
-   |               function or associated item not found in `Vec<Q>`
-   |               help: there is an associated function with a similar name: `new`
+   |               ^^^ function or associated item not found in `Vec<Q>`
    |
 note: if you're trying to build a new `Vec<Q>` consider using one of the following associated functions:
       Vec::<T>::new
@@ -14,6 +11,10 @@ note: if you're trying to build a new `Vec<Q>` consider using one of the followi
       Vec::<T, A>::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::<Q>::new()
+   |               ~~~
 
 error: aborting due to 1 previous error