about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-02 03:42:10 +0000
committerMichael Goulet <michael@errs.io>2024-11-02 03:42:10 +0000
commit78bbc648c5b2e6e092167d2ed593cd89f06dd37f (patch)
tree2703a043ef2b9f32ea067f4380dce22a536be7f5 /compiler
parent7c7bb7dc017545db732f5cffec684bbaeae0a9a0 (diff)
downloadrust-78bbc648c5b2e6e092167d2ed593cd89f06dd37f.tar.gz
rust-78bbc648c5b2e6e092167d2ed593cd89f06dd37f.zip
Fix closure arg extraction in extract_callable_info
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
index 553bb61ed04..2ce46ed5a79 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
@@ -1091,7 +1091,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
                         Some((
                             DefIdOrName::DefId(def_id),
                             fn_sig.output(),
-                            fn_sig.inputs().map_bound(|inputs| &inputs[1..]),
+                            fn_sig.inputs().map_bound(|inputs| inputs[0].tuple_fields().as_slice()),
                         ))
                     }
                     ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => {
@@ -1101,7 +1101,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
                             .iter()
                             .find_map(|pred| {
                                 if let ty::ClauseKind::Projection(proj) = pred.kind().skip_binder()
-                        && self.tcx.is_lang_item(proj.projection_term.def_id,LangItem::FnOnceOutput)
+                        && self.tcx.is_lang_item(proj.projection_term.def_id, LangItem::FnOnceOutput)
                         // args tuple will always be args[1]
                         && let ty::Tuple(args) = proj.projection_term.args.type_at(1).kind()
                                 {