about summary refs log tree commit diff
path: root/compiler/rustc_infer
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-17 16:39:01 +0000
committerbors <bors@rust-lang.org>2023-04-17 16:39:01 +0000
commit31656e7295ebd5f2f6597f10c011e2ac4ba3ef39 (patch)
tree71b777fef0884cdd3f05a9b9188fafe427f8cabe /compiler/rustc_infer
parente49122fb1ca87a6c3e3c22abb315fc75cfe8daed (diff)
parentc81e8b8e18253881334e4f4ca7a707c8eccbb905 (diff)
downloadrust-31656e7295ebd5f2f6597f10c011e2ac4ba3ef39.tar.gz
rust-31656e7295ebd5f2f6597f10c011e2ac4ba3ef39.zip
Auto merge of #110458 - matthiaskrgr:rollup-1xcxmgc, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #104055 (Migrate diagnostics in `rustc_borrowck`)
 - #110257 (fix false positives for `unused_parens` around unary and binary operations)
 - #110313 (allow `repr(align = x)` on inherent methods)
 - #110337 (Correct default value for default-linker-libraries)
 - #110386 (Clean up traversal macros)
 - #110394 (Various minor Idx-related tweaks)
 - #110425 (Encode def span for `ConstParam`)
 - #110434 (Check freeze with right param-env in `deduced_param_attrs`)
 - #110455 (tests: adapt for LLVM change 5b386b864c7619897c51a1da97d78f1cf6f3eff6)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_infer')
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/suggest.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
index 4dc5fc451dd..d885d040707 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
@@ -10,7 +10,6 @@ use rustc_middle::traits::{
 use rustc_middle::ty::print::with_no_trimmed_paths;
 use rustc_middle::ty::{self as ty, GenericArgKind, IsSuggestable, Ty, TypeVisitableExt};
 use rustc_span::{sym, BytePos, Span};
-use rustc_target::abi::FieldIdx;
 
 use crate::errors::{
     ConsiderAddingAwait, FnConsiderCasting, FnItemsAreDistinct, FnUniqTypes,
@@ -114,7 +113,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                         variant.fields.len() == 1 && variant.ctor_kind() == Some(CtorKind::Fn)
                     })
                     .filter_map(|variant| {
-                        let sole_field = &variant.fields[FieldIdx::from_u32(0)];
+                        let sole_field = &variant.single_field();
                         let sole_field_ty = sole_field.ty(self.tcx, substs);
                         if self.same_type_modulo_infer(sole_field_ty, exp_found.found) {
                             let variant_path =