Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3ae6901
rustc_target: callconv: powerpc64: Use the ABI set in target options …
Gelbpunkt Jan 13, 2026
168f324
rustc_target: spec: Ensure that a valid llvm_abiname value is set for…
Gelbpunkt Jan 13, 2026
c45a513
Fix ICE in const eval when using packed SIMD with non-power-of-two le…
enthropy7 Jan 25, 2026
f1c80f5
reduce the amount of panics in `{TokenStream, Literal}::from_str` calls
cyrgani Jan 26, 2026
ce4c17f
Simplify internals of `{Rc,Arc}::default`
alexcrichton Feb 13, 2026
a2699f0
Test(lib/win/proc): Skip `raw_attributes` doctest under Win7
PaulDance Oct 15, 2025
f067c75
fix typo in `carryless_mul` macro invocation
folkertdev Feb 17, 2026
6314bd7
fix(codegen): Use `body_codegen_attrs` for caller in `adjust_target_f…
TKanX Feb 19, 2026
034f7f0
test(codegen): Add regression test for issue #152340
TKanX Feb 19, 2026
6c6f586
Fix warnings in rs{begin,end}.rs files
mati865 Feb 19, 2026
d6ff921
Fixed ByteStr not padding within its Display trait when no specific a…
asder8215 Feb 19, 2026
bb2d55e
Add new `MultiSpan` methods: `push_primary_span`, `push_span_diag` an…
GuillaumeGomez Feb 21, 2026
36116e3
Create new `diag_lint_level` function, aiming to replace `lint_level`…
GuillaumeGomez Feb 21, 2026
4f23c48
Migrate `LinkerOutput` lint to `Diagnostic`
GuillaumeGomez Feb 21, 2026
223c253
remove unneeded reboxing
cyrgani Feb 21, 2026
417e4f9
Fix typo in armv7a-vex-v5.md
willschlitzer Feb 22, 2026
a3d5908
Remove `impl IntoQueryParam<P> for &'a P`.
nnethercote Feb 19, 2026
fde010c
Rollup merge of #150468 - Gelbpunkt:rustc-target-callconv-spec-elf-ab…
JonathanBrouwer Feb 22, 2026
0f9a36e
Rollup merge of #151628 - enthropy7:fix-simd-const-eval-ice, r=RalfJung
JonathanBrouwer Feb 22, 2026
9cf2aa6
Rollup merge of #152591 - alexcrichton:simplify-rc-arc-default, r=joboet
JonathanBrouwer Feb 22, 2026
63e0e6a
Rollup merge of #152865 - asder8215:path_display, r=joboet
JonathanBrouwer Feb 22, 2026
471930f
Rollup merge of #147859 - cyrgani:nonfatal-tokenstream-parse, r=petro…
JonathanBrouwer Feb 22, 2026
d1c3304
Rollup merge of #152705 - PaulDance:patches/skip-raw_attributes-docte…
JonathanBrouwer Feb 22, 2026
85eab51
Rollup merge of #152767 - folkertdev:clmul-rhs-lhs, r=joboet
JonathanBrouwer Feb 22, 2026
81a79bf
Rollup merge of #152837 - TKanX:bugfix/152340-codegen-fn-attrs-const-…
JonathanBrouwer Feb 22, 2026
f9d0402
Rollup merge of #152871 - mati865:fix-rs-begin-end-warnings, r=joboet
JonathanBrouwer Feb 22, 2026
1c88fbe
Rollup merge of #152879 - nnethercote:rm-impl-IntoQueryParam-ref-P, r…
JonathanBrouwer Feb 22, 2026
8c1e507
Rollup merge of #152933 - GuillaumeGomez:start-migrating-lintdiag, r=…
JonathanBrouwer Feb 22, 2026
c8e8707
Rollup merge of #152937 - cyrgani:box-box, r=JonathanBrouwer
JonathanBrouwer Feb 22, 2026
26000b9
Rollup merge of #152953 - willschlitzer:patch-1, r=petrochenkov
JonathanBrouwer Feb 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4211,9 +4211,7 @@ impl ForeignItemKind {
impl From<ForeignItemKind> for ItemKind {
fn from(foreign_item_kind: ForeignItemKind) -> ItemKind {
match foreign_item_kind {
ForeignItemKind::Static(box static_foreign_item) => {
ItemKind::Static(Box::new(static_foreign_item))
}
ForeignItemKind::Static(static_foreign_item) => ItemKind::Static(static_foreign_item),
ForeignItemKind::Fn(fn_kind) => ItemKind::Fn(fn_kind),
ForeignItemKind::TyAlias(ty_alias_kind) => ItemKind::TyAlias(ty_alias_kind),
ForeignItemKind::MacCall(a) => ItemKind::MacCall(a),
Expand All @@ -4226,7 +4224,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {

fn try_from(item_kind: ItemKind) -> Result<ForeignItemKind, ItemKind> {
Ok(match item_kind {
ItemKind::Static(box static_item) => ForeignItemKind::Static(Box::new(static_item)),
ItemKind::Static(static_item) => ForeignItemKind::Static(static_item),
ItemKind::Fn(fn_kind) => ForeignItemKind::Fn(fn_kind),
ItemKind::TyAlias(ty_alias_kind) => ForeignItemKind::TyAlias(ty_alias_kind),
ItemKind::MacCall(a) => ForeignItemKind::MacCall(a),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/move_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
let predicates = match parent.kind {
hir::ExprKind::Call(callee, _) => {
let ty = typeck_result.node_type_opt(callee.hir_id)?;
let ty::FnDef(fn_def_id, args) = ty.kind() else { return None };
let ty::FnDef(fn_def_id, args) = *ty.kind() else { return None };
tcx.predicates_of(fn_def_id).instantiate(tcx, args)
}
hir::ExprKind::MethodCall(..) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
}
_ => {
let local = &self.body.local_decls[local];
match local.local_info() {
match *local.local_info() {
LocalInfo::StaticRef { def_id, .. } => {
let span = self.infcx.tcx.def_span(def_id);
err.span_label(span, format!("this `static` cannot be {acted_on}"));
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/region_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
let tcx = self.infcx.tcx;

let ConstraintCategory::CallArgument(Some(func_ty)) = category else { return };
let ty::FnDef(fn_did, args) = func_ty.kind() else { return };
let ty::FnDef(fn_did, args) = *func_ty.kind() else { return };
debug!(?fn_did, ?args);

// Only suggest this on function calls, not closures
Expand All @@ -938,7 +938,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
let Ok(Some(instance)) = ty::Instance::try_resolve(
tcx,
self.infcx.typing_env(self.infcx.param_env),
*fn_did,
fn_did,
self.infcx.resolve_vars_if_possible(args),
) else {
return;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,12 +1013,12 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
let is_implicit_coercion = coercion_source == CoercionSource::Implicit;
let src_ty = op.ty(self.body, tcx);
let mut src_sig = src_ty.fn_sig(tcx);
if let ty::FnDef(def_id, _) = src_ty.kind()
if let ty::FnDef(def_id, _) = *src_ty.kind()
&& let ty::FnPtr(_, target_hdr) = *ty.kind()
&& tcx.codegen_fn_attrs(def_id).safe_target_features
&& target_hdr.safety.is_safe()
&& let Some(safe_sig) = tcx.adjust_target_feature_sig(
*def_id,
def_id,
src_sig,
self.body.source.def_id(),
)
Expand Down
12 changes: 5 additions & 7 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ use rustc_attr_parsing::eval_config_entry;
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
use rustc_data_structures::memmap::Mmap;
use rustc_data_structures::temp_dir::MaybeTempDir;
use rustc_errors::{DiagCtxtHandle, LintDiagnostic};
use rustc_errors::DiagCtxtHandle;
use rustc_fs_util::{TempDirBuilder, fix_windows_verbatim_for_gcc, try_canonicalize};
use rustc_hir::attrs::NativeLibKind;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_macros::LintDiagnostic;
use rustc_macros::Diagnostic;
use rustc_metadata::fs::{METADATA_FILENAME, copy_to_stdout, emit_wrapper_file};
use rustc_metadata::{
EncodedMetadata, NativeLibSearchFallback, find_native_static_library,
walk_native_lib_search_dirs,
};
use rustc_middle::bug;
use rustc_middle::lint::lint_level;
use rustc_middle::lint::diag_lint_level;
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
use rustc_middle::middle::dependency_format::Linkage;
use rustc_middle::middle::exported_symbols::SymbolExportKind;
Expand Down Expand Up @@ -662,7 +662,7 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out
}
}

#[derive(LintDiagnostic)]
#[derive(Diagnostic)]
#[diag("{$inner}")]
/// Translating this is kind of useless. We don't pass translation flags to the linker, so we'd just
/// end up with inconsistent languages within the same diagnostic.
Expand Down Expand Up @@ -938,9 +938,7 @@ fn link_natively(

let level = codegen_results.crate_info.lint_levels.linker_messages;
let lint = |msg| {
lint_level(sess, LINKER_MESSAGES, level, None, |diag| {
LinkerOutput { inner: msg }.decorate_lint(diag)
})
diag_lint_level(sess, LINKER_MESSAGES, level, None, LinkerOutput { inner: msg });
};

if !prog.stderr.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/check_consts/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {

Rvalue::Aggregate(kind, ..) => {
if let AggregateKind::Coroutine(def_id, ..) = kind.as_ref()
&& let Some(coroutine_kind) = self.tcx.coroutine_kind(def_id)
&& let Some(coroutine_kind) = self.tcx.coroutine_kind(*def_id)
{
self.check_op(ops::Coroutine(coroutine_kind));
}
Expand Down
16 changes: 14 additions & 2 deletions compiler/rustc_const_eval/src/interpret/intrinsics/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use either::Either;
use rustc_abi::{BackendRepr, Endian};
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
use rustc_apfloat::{Float, Round};
use rustc_data_structures::assert_matches;
use rustc_middle::mir::interpret::{InterpErrorKind, Pointer, UndefinedBehaviorInfo};
use rustc_middle::ty::{FloatTy, ScalarInt, SimdAlign};
use rustc_middle::{bug, err_ub_format, mir, span_bug, throw_unsup_format, ty};
Expand Down Expand Up @@ -838,7 +837,20 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
vector_layout: TyAndLayout<'tcx>,
alignment: SimdAlign,
) -> InterpResult<'tcx> {
assert_matches!(vector_layout.backend_repr, BackendRepr::SimdVector { .. });
// Packed SIMD types with non-power-of-two element counts use BackendRepr::Memory
// instead of BackendRepr::SimdVector. We need to handle both cases.
// FIXME: remove the BackendRepr::Memory case when SIMD vectors are always passed as BackendRepr::SimdVector.
assert!(vector_layout.ty.is_simd(), "check_simd_ptr_alignment called on non-SIMD type");
match vector_layout.backend_repr {
BackendRepr::SimdVector { .. } | BackendRepr::Memory { .. } => {}
_ => {
span_bug!(
self.cur_span(),
"SIMD type has unexpected backend_repr: {:?}",
vector_layout.backend_repr
);
}
}

let align = match alignment {
ty::SimdAlign::Unaligned => {
Expand Down
13 changes: 13 additions & 0 deletions compiler/rustc_error_messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,18 @@ impl MultiSpan {
MultiSpan { primary_spans: vec, span_labels: vec![] }
}

pub fn push_primary_span(&mut self, primary_span: Span) {
self.primary_spans.push(primary_span);
}

pub fn push_span_label(&mut self, span: Span, label: impl Into<DiagMessage>) {
self.span_labels.push((span, label.into()));
}

pub fn push_span_diag(&mut self, span: Span, diag: DiagMessage) {
self.span_labels.push((span, diag));
}

/// Selects the first primary span (if any).
pub fn primary_span(&self) -> Option<Span> {
self.primary_spans.first().cloned()
Expand Down Expand Up @@ -179,6 +187,11 @@ impl MultiSpan {
span_labels
}

/// Returns the span labels as contained by `MultiSpan`.
pub fn span_labels_raw(&self) -> &[(Span, DiagMessage)] {
&self.span_labels
}

/// Returns `true` if any of the span labels is displayable.
pub fn has_span_labels(&self) -> bool {
self.span_labels.iter().any(|(sp, _)| !sp.is_dummy())
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,13 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> {
drop(self);
}

/// Cancels this diagnostic and returns its first message, if it exists.
pub fn cancel_into_message(self) -> Option<String> {
let s = self.diag.as_ref()?.messages.get(0)?.0.as_str().map(ToString::to_string);
self.cancel();
s
}

/// See `DiagCtxt::stash_diagnostic` for details.
pub fn stash(mut self, span: Span, key: StashKey) -> Option<ErrorGuaranteed> {
let diag = self.take_diag();
Expand Down
37 changes: 22 additions & 15 deletions compiler/rustc_expand/src/proc_macro_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{Diag, ErrorGuaranteed, MultiSpan};
use rustc_parse::lexer::{StripTokens, nfc_normalize};
use rustc_parse::parser::Parser;
use rustc_parse::{exp, new_parser_from_source_str, source_str_to_stream, unwrap_or_emit_fatal};
use rustc_parse::{exp, new_parser_from_source_str, source_str_to_stream};
use rustc_proc_macro::bridge::{
DelimSpan, Diagnostic, ExpnGlobals, Group, Ident, LitKind, Literal, Punct, TokenTree, server,
};
Expand Down Expand Up @@ -415,6 +415,13 @@ impl ToInternal<rustc_errors::Level> for Level {
}
}

fn cancel_diags_into_string(diags: Vec<Diag<'_>>) -> String {
let mut messages = diags.into_iter().flat_map(Diag::cancel_into_message);
let msg = messages.next().expect("no diagnostic has a message");
messages.for_each(|_| ()); // consume iterator to cancel the remaining diagnostics
msg
}

pub(crate) struct Rustc<'a, 'b> {
ecx: &'a mut ExtCtxt<'b>,
def_site: Span,
Expand Down Expand Up @@ -478,35 +485,32 @@ impl server::Server for Rustc<'_, '_> {
self.psess().file_depinfo.borrow_mut().insert(Symbol::intern(path));
}

fn literal_from_str(&mut self, s: &str) -> Result<Literal<Self::Span, Self::Symbol>, ()> {
fn literal_from_str(&mut self, s: &str) -> Result<Literal<Self::Span, Self::Symbol>, String> {
let name = FileName::proc_macro_source_code(s);

let mut parser = unwrap_or_emit_fatal(new_parser_from_source_str(
self.psess(),
name,
s.to_owned(),
StripTokens::Nothing,
));
let mut parser =
new_parser_from_source_str(self.psess(), name, s.to_owned(), StripTokens::Nothing)
.map_err(cancel_diags_into_string)?;

let first_span = parser.token.span.data();
let minus_present = parser.eat(exp!(Minus));

let lit_span = parser.token.span.data();
let token::Literal(mut lit) = parser.token.kind else {
return Err(());
return Err("not a literal".to_string());
};

// Check no comment or whitespace surrounding the (possibly negative)
// literal, or more tokens after it.
if (lit_span.hi.0 - first_span.lo.0) as usize != s.len() {
return Err(());
return Err("comment or whitespace around literal".to_string());
}

if minus_present {
// If minus is present, check no comment or whitespace in between it
// and the literal token.
if first_span.hi.0 != lit_span.lo.0 {
return Err(());
return Err("comment or whitespace after minus".to_string());
}

// Check literal is a kind we allow to be negated in a proc macro token.
Expand All @@ -520,7 +524,9 @@ impl server::Server for Rustc<'_, '_> {
| token::LitKind::ByteStrRaw(_)
| token::LitKind::CStr
| token::LitKind::CStrRaw(_)
| token::LitKind::Err(_) => return Err(()),
| token::LitKind::Err(_) => {
return Err("non-numeric literal may not be negated".to_string());
}
token::LitKind::Integer | token::LitKind::Float => {}
}

Expand Down Expand Up @@ -560,13 +566,14 @@ impl server::Server for Rustc<'_, '_> {
stream.is_empty()
}

fn ts_from_str(&mut self, src: &str) -> Self::TokenStream {
unwrap_or_emit_fatal(source_str_to_stream(
fn ts_from_str(&mut self, src: &str) -> Result<Self::TokenStream, String> {
source_str_to_stream(
self.psess(),
FileName::proc_macro_source_code(src),
src.to_string(),
Some(self.call_site),
))
)
.map_err(cancel_diags_into_string)
}

fn ts_to_string(&mut self, stream: &Self::TokenStream) -> String {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ fn check_impl_items_against_trait<'tcx>(
match impl_trait_header.polarity {
ty::ImplPolarity::Reservation | ty::ImplPolarity::Positive => {}
ty::ImplPolarity::Negative => {
if let [first_item_ref, ..] = impl_item_refs {
if let [first_item_ref, ..] = *impl_item_refs {
let first_item_span = tcx.def_span(first_item_ref);
struct_span_code_err!(
tcx.dcx(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ fn check_region_late_boundedness<'tcx>(
.iter()
.map(|param| {
let (LateEarlyMismatch::EarlyInImpl(impl_param_def_id, ..)
| LateEarlyMismatch::LateInImpl(impl_param_def_id, ..)) = param;
| LateEarlyMismatch::LateInImpl(impl_param_def_id, ..)) = *param;
tcx.def_span(impl_param_def_id)
})
.collect();
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2445,12 +2445,12 @@ fn is_late_bound_map(
)) => {
// See comments on `ConstrainedCollectorPostHirTyLowering` for why this arm does not
// just consider args to be unconstrained.
let generics = self.tcx.generics_of(alias_def);
let generics = self.tcx.generics_of(*alias_def);
let mut walker = ConstrainedCollectorPostHirTyLowering {
arg_is_constrained: vec![false; generics.own_params.len()]
.into_boxed_slice(),
};
walker.visit_ty(self.tcx.type_of(alias_def).instantiate_identity());
walker.visit_ty(self.tcx.type_of(*alias_def).instantiate_identity());

match segments.last() {
Some(hir::PathSegment { args: Some(args), .. }) => {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
if let [best_trait] = visible_traits
.iter()
.copied()
.filter(|trait_def_id| {
.filter(|&trait_def_id| {
tcx.associated_items(trait_def_id)
.filter_by_name_unhygienic(suggested_name)
.any(|item| item.tag() == assoc_tag)
Expand Down Expand Up @@ -1234,7 +1234,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
&& let name = Symbol::intern(&format!("{ident2}_{ident3}"))
&& let Some(item) = inherent_impls
.iter()
.flat_map(|inherent_impl| {
.flat_map(|&inherent_impl| {
tcx.associated_items(inherent_impl).filter_by_name_unhygienic(name)
})
.next()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/impl_wf_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub(crate) fn enforce_impl_lifetime_params_are_constrained(
let lifetimes_in_associated_types: FxHashSet<_> = tcx
.associated_item_def_ids(impl_def_id)
.iter()
.flat_map(|def_id| {
.flat_map(|&def_id| {
let item = tcx.associated_item(def_id);
match item.kind {
ty::AssocKind::Type { .. } => {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
result = self.try_overloaded_call_step(call_expr, callee_expr, arg_exprs, &autoderef);
}

match autoderef.final_ty().kind() {
match *autoderef.final_ty().kind() {
ty::FnDef(def_id, _) => {
let abi = self.tcx.fn_sig(def_id).skip_binder().skip_binder().abi;
self.check_call_abi(abi, call_expr.span);
Expand Down Expand Up @@ -430,11 +430,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}

fn is_scalable_vector_ctor(&self, callee_ty: Ty<'_>) -> bool {
if let ty::FnDef(def_id, _) = callee_ty.kind()
if let ty::FnDef(def_id, _) = *callee_ty.kind()
&& let def::DefKind::Ctor(def::CtorOf::Struct, _) = self.tcx.def_kind(def_id)
{
self.tcx
.opt_parent(*def_id)
.opt_parent(def_id)
.and_then(|id| self.tcx.adt_def(id).repr().scalable)
.is_some()
} else {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.tcx
.inherent_impls(def_id)
.into_iter()
.flat_map(|i| self.tcx.associated_items(i).in_definition_order())
.flat_map(|&i| self.tcx.associated_items(i).in_definition_order())
// Only assoc fn with no receivers.
.filter(|item| item.is_fn() && !item.is_method())
.filter_map(|item| {
Expand Down Expand Up @@ -3183,7 +3183,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

// Check if there is an associated function with the same name.
if let Some(def_id) = base_ty.peel_refs().ty_adt_def().map(|d| d.did()) {
for impl_def_id in self.tcx.inherent_impls(def_id) {
for &impl_def_id in self.tcx.inherent_impls(def_id) {
for item in self.tcx.associated_items(impl_def_id).in_definition_order() {
if let ExprKind::Field(base_expr, _) = expr.kind
&& item.name() == field.name
Expand Down
Loading
Loading