Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0439f4e
Hint that memchr returns an in-bounds index
SomeFlyingThing Jul 23, 2026
c1f36d5
Hint that memrchr returns an in-bounds index
SomeFlyingThing Jul 24, 2026
ea475ff
add test which should pass
bit-aloo Jul 14, 2026
62e3e3d
Add helper for equality-constrainable assoc items
bit-aloo Jul 18, 2026
f86e9f6
Allow associated const equality constraints with MGCA
bit-aloo Jul 18, 2026
cd57bc3
Correct the statments
bit-aloo Jul 20, 2026
faebca4
Remove NonType assocConstViolation variant, as we don't need it anymore
bit-aloo Jul 20, 2026
a8087a3
Gate non-type assoc const equality on generic_const_args
bit-aloo Jul 21, 2026
4077496
add dyn generic non type assoc const
bit-aloo Jul 23, 2026
ad7e5e2
add lack_of_wfcheck for gca
bit-aloo Jul 23, 2026
2191fc1
Revise generic const args WF test and split GAT case
bit-aloo Jul 25, 2026
844c01e
Cover memchr fast path with bounds assertion
SomeFlyingThing Jul 27, 2026
49c1f02
Fix memchr result CI checks
SomeFlyingThing Jul 27, 2026
807750a
Preserve memchr codegen on LLVM 21
SomeFlyingThing Jul 28, 2026
bdbfee0
Split `aarch64-apple{,-macos-26}` => `aarch64-apple{,-macos-26}-{1,2}…
jieyouxu Aug 3, 2026
e90ed38
Remove unused args from `ConstAnalysis` methods
nnethercote Aug 4, 2026
6377970
Split `apply_primary_terminator_effect`
nnethercote Aug 4, 2026
099db74
Update error message in documentation comments
SzilvasiPeter Aug 5, 2026
e6b1e68
Cap socket send length to c_int::MAX on Apple targets
devnexen Jul 18, 2026
cefe30f
Return EMSGSIZE for oversized datagram sends
devnexen Jul 18, 2026
4507211
Expose EMSGSIZE in the Windows netc shim
devnexen Jul 18, 2026
28e1c85
Add test for oversized datagram sends
devnexen Jul 18, 2026
6477fb5
address feedbacks
devnexen Jul 25, 2026
08f76dd
Share the zeroed-mmap test buffer between the TCP and UDP tests
devnexen Aug 5, 2026
0ae62fb
Add regression test for array type recovery in generic arguments
zakrad Aug 5, 2026
0aa333d
Add tests for new solver issues
Randl Aug 5, 2026
7eac635
fix: use fully qualified paths in `walk_visitable_list!`
ada4a Aug 5, 2026
fee8922
rustc_abi: Add `LayoutData::is_variant_uninhabited` method
moulins Aug 2, 2026
187cf5d
Add a doc comment to `TyAndLayout` discouraging its uses when possible
moulins Aug 5, 2026
3a7ae70
use `VisitorResult` helper macros
ada4a Aug 5, 2026
be9602c
expand: Feature gate AST-based attribute macros on expressions and no…
petrochenkov Aug 5, 2026
640032d
fix: Check the fallback map before queueing child in `visible_parent_…
zalanlevai Aug 3, 2026
cd8a97b
Handle LLVM 21 in memchr result codegen test
SomeFlyingThing Aug 5, 2026
354cedd
add test showing difference between datalog polonius and alpha
lqd Aug 5, 2026
0a0f6df
Rename `#[unroll]` => `#[rustc_unroll]` to mitigate nameres ambiguity
jieyouxu Aug 6, 2026
44d291e
Update attr name in `#[unroll]` codegen-llvm tests
jieyouxu Jul 30, 2026
91ee1f3
Update attr name in `#[unroll]` ui tests
jieyouxu Jul 30, 2026
945d2f3
Rebless `rustc-attrs` feature gate test
jieyouxu Jul 30, 2026
d1265b7
Update attr name for `#[unroll]` in Unstable Book
jieyouxu Jul 30, 2026
39b3ad8
Suggest if-let chain continuation on unclosed delimiter
Diacod-I Aug 5, 2026
f207c16
Avoid the std DLL copy alongside rustc
Zoxc Aug 6, 2026
71b8456
check_consts: exhaustively match on CastKind
RalfJung Jul 29, 2026
ed205c7
Rollup merge of #159530 - devnexen:gh115325, r=Darksonn
JonathanBrouwer Aug 6, 2026
55c08c3
Rollup merge of #159784 - SomeFlyingThing:agent/hint-memchr-result-bo…
JonathanBrouwer Aug 6, 2026
4b3463b
Rollup merge of #159506 - bit-aloo:2026-07-14-dyn-compatible-non-type…
JonathanBrouwer Aug 6, 2026
d16b90d
Rollup merge of #160415 - jieyouxu:jieyouxu/ci/macos-fission, r=Mark-…
JonathanBrouwer Aug 6, 2026
11576bd
Rollup merge of #160464 - zalanlevai:fix-visible-parent-map-fallback-…
JonathanBrouwer Aug 6, 2026
14adc90
Rollup merge of #160555 - nnethercote:split-apply_terminator, r=cjgillot
JonathanBrouwer Aug 6, 2026
834dc7c
Rollup merge of #160592 - Diacod-I:if-let-chain-unclosed-delim-hint, …
JonathanBrouwer Aug 6, 2026
9356258
Rollup merge of #160600 - Zoxc:no-extra-std-dll, r=Kobzol
JonathanBrouwer Aug 6, 2026
552929d
Rollup merge of #160156 - RalfJung:cast-kind-const-check, r=oli-obk
JonathanBrouwer Aug 6, 2026
a10d172
Rollup merge of #160211 - jieyouxu:froot-loops, r=mati865
JonathanBrouwer Aug 6, 2026
052c219
Rollup merge of #160304 - Randl:new_tests, r=adwinwhite
JonathanBrouwer Aug 6, 2026
e324aa4
Rollup merge of #160398 - moulins:layout-is-variant-uninhabited, r=ol…
JonathanBrouwer Aug 6, 2026
01b5523
Rollup merge of #160546 - SzilvasiPeter:main, r=JohnTitor
JonathanBrouwer Aug 6, 2026
4388e11
Rollup merge of #160568 - ada4a:ada/push-vklwmykymnxk, r=jdonszelmann
JonathanBrouwer Aug 6, 2026
7293f16
Rollup merge of #160571 - zakrad:regr-test-81097, r=jieyouxu
JonathanBrouwer Aug 6, 2026
fbf6be9
Rollup merge of #160577 - petrochenkov:astgate, r=khyperia
JonathanBrouwer Aug 6, 2026
267a1d1
Rollup merge of #160588 - lqd:nighty-wheat-thins, r=jackh726
JonathanBrouwer Aug 6, 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
7 changes: 7 additions & 0 deletions compiler/rustc_abi/src/layout/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ pub trait TyAbiInterface<'a, C>: Sized + std::fmt::Debug + std::fmt::Display {
}

impl<'a, Ty> TyAndLayout<'a, Ty> {
/// Synthetize a layout representing the variant-specific fields of an enum-like layout.
///
/// Note that the resulting layout *does not* fully describes `self.ty` at that specific
/// variant: prefix fields (e.g. in coroutines) and tag information are lost.
///
/// If you don't need type information about the variant's fields, prefer using
/// `self.layout.variants` directly.
pub fn for_variant<C>(self, cx: &C, variant_index: VariantIdx) -> Self
where
Ty: TyAbiInterface<'a, C>,
Expand Down
11 changes: 11 additions & 0 deletions compiler/rustc_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,17 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutData<FieldIdx, VariantIdx> {
pub fn is_uninhabited(&self) -> bool {
self.uninhabited
}

/// Returns `true` if the given variant is uninhabited.
pub fn is_variant_uninhabited(&self, variant: VariantIdx) -> bool {
match self.variants {
Variants::Empty => true,
Variants::Single { index } => variant != index || self.uninhabited,
Variants::Multiple { ref variants, .. } => {
variants.get(variant).map(|v| v.uninhabited).unwrap_or(true)
}
}
}
}

impl<FieldIdx: Idx, VariantIdx: Idx> fmt::Debug for LayoutData<FieldIdx, VariantIdx>
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_ir/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ macro_rules! walk_list {
macro_rules! walk_visitable_list {
($visitor: expr, $list: expr $(, $($extra_args: expr),* )?) => {
for elem in $list {
$crate::try_visit!(elem.visit_with($visitor $(, $($extra_args,)* )?));
$crate::try_visit!(::rustc_type_ir::TypeVisitable::visit_with(elem, $visitor $(, $($extra_args,)* )?));
}
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/unroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use super::prelude::*;

pub(crate) struct UnrollParser;
impl SingleAttributeParser for UnrollParser {
const PATH: &[Symbol] = &[sym::unroll];
// FIXME(#159429): temporarily renamed to mitigate `#[unroll]` nameres ambiguity.
const PATH: &[Symbol] = &[sym::rustc_unroll];
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::Loop),
Allow(Target::ForLoop),
Expand Down
21 changes: 7 additions & 14 deletions compiler/rustc_borrowck/src/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use std::fmt;

use rustc_data_structures::fx::FxIndexMap;
use rustc_index::bit_set::{DenseBitSet, MixedBitSet};
use rustc_middle::mir::{
self, BasicBlock, Body, CallReturnPlaces, Location, Place, TerminatorEdges,
};
use rustc_middle::mir::{self, BasicBlock, Body, CallReturnPlaces, Location, Place};
use rustc_middle::ty::{RegionVid, TyCtxt};
use rustc_mir_dataflow::fmt::DebugWithContext;
use rustc_mir_dataflow::impls::{
Expand Down Expand Up @@ -76,19 +74,15 @@ impl<'a, 'tcx> Analysis<'tcx> for Borrowck<'a, 'tcx> {
self.ever_inits.apply_early_terminator_effect(&mut state.ever_inits, term, loc);
}

fn apply_primary_terminator_effect<'mir>(
fn apply_primary_terminator_effect(
&self,
state: &mut Self::Domain,
term: &'mir mir::Terminator<'tcx>,
term: &mir::Terminator<'tcx>,
loc: Location,
) -> TerminatorEdges<'mir, 'tcx> {
) {
self.borrows.apply_primary_terminator_effect(&mut state.borrows, term, loc);
self.uninits.apply_primary_terminator_effect(&mut state.uninits, term, loc);
self.ever_inits.apply_primary_terminator_effect(&mut state.ever_inits, term, loc);

// This return value doesn't matter. It's only used by `iterate_to_fixpoint`, which this
// analysis doesn't use.
TerminatorEdges::None
}

fn apply_call_return_effect(
Expand Down Expand Up @@ -598,12 +592,12 @@ impl<'tcx> rustc_mir_dataflow::Analysis<'tcx> for Borrows<'_, 'tcx> {
self.kill_loans_out_of_scope_at_location(state, location);
}

fn apply_primary_terminator_effect<'mir>(
fn apply_primary_terminator_effect(
&self,
state: &mut Self::Domain,
terminator: &'mir mir::Terminator<'tcx>,
terminator: &mir::Terminator<'tcx>,
_location: Location,
) -> TerminatorEdges<'mir, 'tcx> {
) {
if let mir::TerminatorKind::InlineAsm { operands, .. } = &terminator.kind {
for op in operands {
if let mir::InlineAsmOperand::Out { place: Some(place), .. }
Expand All @@ -613,7 +607,6 @@ impl<'tcx> rustc_mir_dataflow::Analysis<'tcx> for Borrows<'_, 'tcx> {
}
}
}
terminator.edges()
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/discriminant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
variant_index: VariantIdx,
) {
let layout = place.layout();
if layout.for_variant(fx, variant_index).is_uninhabited() {
if layout.is_variant_uninhabited(variant_index) {
return;
}
match layout.variants {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ pub(super) fn codegen_tag_value<'tcx, V>(
) -> Result<Option<(FieldIdx, V)>, UninhabitedVariantError> {
// By checking uninhabited-ness first we don't need to worry about types
// like `(u32, !)` which are single-variant but weird.
if layout.for_variant(cx, variant_index).is_uninhabited() {
if layout.is_variant_uninhabited(variant_index) {
return Err(UninhabitedVariantError);
}

Expand Down
22 changes: 16 additions & 6 deletions compiler/rustc_const_eval/src/check_consts/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,28 +626,38 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
}

Rvalue::Cast(
CastKind::PointerCoercion(
CastKind::IntToInt
| CastKind::FloatToInt
| CastKind::FloatToFloat
| CastKind::IntToFloat
| CastKind::PtrToPtr
| CastKind::FnPtrToPtr
| CastKind::Transmute
| CastKind::BoxDerefTransmute
| CastKind::PointerCoercion(
PointerCoercion::MutToConstPointer
| PointerCoercion::ArrayToPointer
| PointerCoercion::UnsafeFnPointer
| PointerCoercion::ClosureFnPointer(_)
| PointerCoercion::ReifyFnPointer(_),
| PointerCoercion::ReifyFnPointer(_)
| PointerCoercion::Unsize,
_,
),
_,
_,
) => {
// These are all okay; they only change the type, not the data.
// Operations that are fully supported by const-eval.
}

// Special checks for special casts
Rvalue::Cast(CastKind::PointerExposeProvenance, _, _) => {
self.check_op(ops::RawPtrToIntCast);
}
Rvalue::Cast(CastKind::PointerWithExposedProvenance, _, _) => {
// Since no pointer can ever get exposed (rejected above), this is easy to support.
}

Rvalue::Cast(_, _, _) => {}
Rvalue::Cast(kind @ CastKind::Subtype, _, _) => {
span_bug!(self.span, "invalid CastKind for this MIR phase: {kind:?}");
}

Rvalue::UnaryOp(op, operand) => {
let ty = operand.ty(self.body, self.tcx);
Expand Down
9 changes: 4 additions & 5 deletions compiler/rustc_const_eval/src/check_consts/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::marker::PhantomData;
use rustc_index::bit_set::MixedBitSet;
use rustc_middle::mir::visit::Visitor;
use rustc_middle::mir::{
self, BasicBlock, CallReturnPlaces, Local, Location, Statement, StatementKind, TerminatorEdges,
self, BasicBlock, CallReturnPlaces, Local, Location, Statement, StatementKind,
};
use rustc_mir_dataflow::fmt::DebugWithContext;
use rustc_mir_dataflow::{Analysis, JoinSemiLattice};
Expand Down Expand Up @@ -351,14 +351,13 @@ where
self.transfer_function(state).visit_statement(statement, location);
}

fn apply_primary_terminator_effect<'mir>(
fn apply_primary_terminator_effect(
&self,
state: &mut Self::Domain,
terminator: &'mir mir::Terminator<'tcx>,
terminator: &mir::Terminator<'tcx>,
location: Location,
) -> TerminatorEdges<'mir, 'tcx> {
) {
self.transfer_function(state).visit_terminator(terminator, location);
terminator.edges()
}

fn apply_call_return_effect(
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_const_eval/src/interpret/discriminant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// Reading the discriminant of an uninhabited variant is UB. This is the basis for the
// `uninhabited_enum_branching` MIR pass. It also ensures consistency with
// `write_discriminant`.
if op.layout().for_variant(self, index).is_uninhabited() {
if op.layout().is_variant_uninhabited(index) {
throw_ub!(UninhabitedEnumVariantRead(Some(index)))
}
interp_ok(index)
Expand Down Expand Up @@ -252,7 +252,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// Therefore, there's no way to represent those variants in the given layout.
// Essentially, uninhabited variants do not have a tag that corresponds to their
// discriminant, so we have to bail out here.
if layout.for_variant(self, variant_index).is_uninhabited() {
if layout.is_variant_uninhabited(variant_index) {
throw_ub!(UninhabitedEnumVariantWritten(variant_index))
}

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
Err(guar) => return ExpandResult::Ready(fragment_kind.dummy(span, guar)),
}
} else if let SyntaxExtensionKind::LegacyAttr(expander) = ext {
self.gate_proc_macro_attr_item(span, &item);
// `LegacyAttr` is only used for builtin attribute macros, which have their
// safety checked by `check_builtin_meta_item`, so we don't need to check
// `unsafety` here.
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ pub static BUILTIN_ATTRIBUTES: &[Symbol] = &[
// - https://github.com/rust-lang/rust/issues/153629
sym::rustc_splat,

// The `#[unroll]` attribute.
// The `#[rustc_unroll]` attribute.
//
// - https://github.com/rust-lang/rust/pull/156816
sym::unroll,
//
// FIXME(#159429): temporarily renamed to mitigate `#[unroll]` nameres ambiguity
sym::rustc_unroll,

// `#[instrument_fn = "on|off"]` to insert or inhibit instrumentation function
// calls inside a function, usually around the prologue.
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir/src/attrs/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,8 @@ pub enum AttributeKind {
limit: Limit,
},

/// Represents `#[unroll]`
/// Represents `#[rustc_unroll]`
// FIXME(#159429): temporarily renamed from `#[unroll]` to mitigate nameres ambiguity
Unroll(UnrollAttr),

/// Represents `#[unstable_feature_bound]`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
items
.in_definition_order()
.filter(|item| {
(item.is_type() || item.is_type_const())
item.can_have_equality_constraint(self.tcx)
&& !item.is_impl_trait_in_trait()
&& !self
.gen_args
Expand Down Expand Up @@ -1016,8 +1016,9 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
// that would result in invalid syntax (fixes #116464)
if !self.is_in_trait_impl() {
let unused_generics = &self.gen_args.args[self.num_expected_type_or_const_args()..];
let mut unbound_assoc_consts =
unbound_assoc_items.iter().filter(|item| item.is_type_const());
let mut unbound_assoc_consts = unbound_assoc_items
.iter()
.filter(|item| matches!(item.kind, ty::AssocKind::Const { .. }));
let mut unbound_assoc_types =
unbound_assoc_items.iter().filter(|item| item.is_type());
let suggestions = unused_generics
Expand Down
9 changes: 6 additions & 3 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,16 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {

if let ty::AssocTag::Const = assoc_tag
&& !self.tcx().is_type_const(assoc_item.def_id)
&& !tcx.features().generic_const_args()
{
if tcx.features().min_generic_const_args() {
let mut err = self.dcx().struct_span_err(
constraint.span,
"use of trait associated const not defined as `type const`",
);
err.note("the declaration in the trait must begin with `type const` not just `const` alone");
err.note(
"the declaration in the trait must begin with `type const` not just `const` alone",
);
return Err(err.emit());
} else {
let err = self.dcx().span_delayed_bug(
Expand All @@ -569,9 +572,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
);
return Err(err);
}
} else {
bounds.push((bound.upcast(tcx), constraint.span));
}

bounds.push((bound.upcast(tcx), constraint.span));
}
// SelfTraitThatDefines is only interested in trait predicates.
PredicateFilter::SelfTraitThatDefines(_) => {}
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
ordered_associated_items.extend(
tcx.associated_items(pred.trait_ref.def_id)
.in_definition_order()
// Only associated types & type consts can possibly be
// constrained in a trait object type via a binding.
.filter(|item| item.is_type() || item.is_type_const())
.filter(|item| item.can_have_equality_constraint(tcx))
// Traits with RPITITs are simply not dyn compatible (for now).
.filter(|item| !item.is_impl_trait_in_trait())
.map(|item| (item.def_id, trait_ref)),
Expand Down
30 changes: 21 additions & 9 deletions compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::any::Any;
use std::mem;
use std::sync::Arc;

use rustc_data_structures::unord::ExtendUnord;
use rustc_hir::attrs::Deprecation;
use rustc_hir::def::{CtorKind, DefKind};
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE};
Expand Down Expand Up @@ -472,7 +473,7 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
// the former.
// This is a rudimentary check that does not catch all cases,
// just the easiest.
let mut fallback_map: Vec<(DefId, DefId)> = Default::default();
let mut fallback_map: DefIdMap<DefId> = Default::default();

// Issue 46112: We want the map to prefer the shortest
// paths when reporting the path to an item. Therefore we
Expand Down Expand Up @@ -533,14 +534,24 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
}
}
Entry::Vacant(entry) => {
if !fallback {
entry.insert(parent);
}

// Make sure that we have not already explored this child
// through a previous fallback entry further up the BFS,
// in which case we do not want to put it back into the BFS queue,
// nor record a new fallback parent.
if fallback_map.contains_key(&def_id) {
return;
}

if fallback {
// We do all of the same steps to fallback entries as to
// preferred entries, except for recording them in a separate map.
// It is important to not return early in the fallback cases to
// ensure that we extend the BFS to the children of fallback items.
fallback_map.push((def_id, parent));
} else {
entry.insert(parent);
fallback_map.insert(def_id, parent);
}

if child.res.module_like_def_id().is_some() {
Expand All @@ -560,12 +571,13 @@ pub(in crate::rmeta) fn provide(providers: &mut Providers) {
// Fill in any missing entries with the less preferable path.
// If this path re-exports the child as `_`, we still use this
// path in a diagnostic that suggests importing `::*`.
// We must extend the fallback map with items from the visible parent map
// as the extend call overrides existing entries from the latter map,
// which we prefer over fallback entries.
let mut merged_visible_parent_map = fallback_map;
merged_visible_parent_map.extend_unord(visible_parent_map.into_items());

for (child, parent) in fallback_map {
visible_parent_map.entry(child).or_insert(parent);
}

visible_parent_map
merged_visible_parent_map
},

dependency_formats: |tcx, ()| Arc::new(crate::dependency_format::calculate(tcx)),
Expand Down
Loading
Loading