Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9c4ead6
Remove legacy homu `try` and `auto` branch mentions
Kobzol Jan 7, 2026
98d3026
Resolve intra-doc links to variant fields behind type aliases
camelid Jan 2, 2026
a90e041
rustdoc: Refactor `def_id_to_res` as `ty_to_res`
camelid Jan 2, 2026
945f3f9
rustdoc: Use trait as root `Res` instead of assoc item
camelid Jan 2, 2026
f503b89
rustdoc: Extract helper function for resolving assoc items on ADTs
camelid Jan 2, 2026
2c98517
Refactor out many free functions from intra-doc link code
camelid Jan 2, 2026
291d0a9
diagnostics: make implicit Sized bounds explicit in E0277
Daniel-B-Smith Jan 6, 2026
2b618ed
rustdoc: Correctly resolve variant and struct fields on alias
camelid Jan 2, 2026
b57c249
fix: make `Type::of` supported unsized types
BD103 Jan 12, 2026
1bde2f4
chore: test `Type::of` on unsized types
BD103 Jan 12, 2026
c98b90e
std: Change UEFI env vars to volatile storage
nicholasbishop Jan 12, 2026
d697b4d
Improve std::path::Path::join documentation
KaiTomotake Jan 4, 2026
37afa31
Remove all usage of FeedConstTy::No
mu001999 Jan 10, 2026
6d837ae
Remove FeedConstTy
mu001999 Jan 11, 2026
bf423e7
Bless tests
mu001999 Jan 11, 2026
d95613a
Fix review comments
mu001999 Jan 12, 2026
c263d36
Fix citool tests
Kobzol Jan 13, 2026
ef9cbad
ui: add regression test for macro resolution ICE
vsriramv Jan 13, 2026
62849e6
Reduce flakyness for `tests/rustdoc-gui/notable-trait.goml`
GuillaumeGomez Jan 13, 2026
e259373
std: move `errno` and related functions into `sys::io`
joboet Jan 6, 2026
0f25fca
update import in UI test
joboet Jan 6, 2026
1d96806
type params on eii
jdonszelmann Jan 10, 2026
d25f471
deduplicate error message when EII has generics
jdonszelmann Jan 10, 2026
b64a9be
bless the tests
jdonszelmann Jan 11, 2026
b454f76
ensure generics are still properly reported on EII *implementations*,…
jdonszelmann Jan 11, 2026
d616e6c
Emit error instead of delayed bug when meeting mismatch type for const
reddevilmidzy Jan 13, 2026
d1c2e5c
Add test for issue 151048
mu001999 Jan 13, 2026
84d59d0
Port `#[rustc_dump_user_args]`
JonathanBrouwer Jan 12, 2026
cf4d480
Port `#[rustc_dump_def_parents]`
JonathanBrouwer Jan 12, 2026
2a45540
Port `#[rustc_dump_item_bounds]`
JonathanBrouwer Jan 12, 2026
a4c34b4
Port `#[rustc_dump_vtable]`
JonathanBrouwer Jan 12, 2026
abcbf72
Port `#[rustc_dump_predicates]`
JonathanBrouwer Jan 12, 2026
73ba4d8
Rollup merge of #150586 - intra-doc-assoc-alias, r=GuillaumeGomez
JonathanBrouwer Jan 13, 2026
de20a80
Rollup merge of #150677 - improve-doc, r=Mark-Simulacrum
JonathanBrouwer Jan 13, 2026
0331737
Rollup merge of #150723 - move_pal_error, r=@tgross35
JonathanBrouwer Jan 13, 2026
29ef5b0
Rollup merge of #150737 - smithdb3/fix-150576, r=chenyukang
JonathanBrouwer Jan 13, 2026
2ca13d4
Rollup merge of #150771 - remove-homu-branches, r=marcoieni
JonathanBrouwer Jan 13, 2026
62c1a26
Rollup merge of #150915 - eii-regression-test-149983, r=kivooeo
JonathanBrouwer Jan 13, 2026
3fe71cb
Rollup merge of #150962 - rm/feed_const_ty, r=BoxyUwU
JonathanBrouwer Jan 13, 2026
d118cb3
Rollup merge of #151017 - rustc_dump, r=jdonszelmann
JonathanBrouwer Jan 13, 2026
b5111b5
Rollup merge of #151019 - type-of-unsized, r=oli-obk
JonathanBrouwer Jan 13, 2026
e7bcab1
Rollup merge of #151034 - bishop-fix-nv, r=joboet
JonathanBrouwer Jan 13, 2026
1a8bbe2
Rollup merge of #151052 - add-test-ice-in-resolve, r=Kivooeo
JonathanBrouwer Jan 13, 2026
9e81d1c
Rollup merge of #151053 - reduce-gui-test-flakyness, r=jieyouxu
JonathanBrouwer Jan 13, 2026
945e6cd
Rollup merge of #151055 - mgca-arr, r=BoxyUwU
JonathanBrouwer Jan 13, 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
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ name: CI
on:
push:
branches:
- auto
- try
- try-perf
- automation/bors/try
- automation/bors/auto
- automation/bors/try
- try-perf
pull_request:
branches:
- "**"
Expand All @@ -33,9 +31,10 @@ defaults:

concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
# We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
# are all triggered on the same branch, but which should be able to run concurrently.
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
# We add an exception for try builds (automation/bors/try branch) and unrolled rollup builds
# (try-perf), which are all triggered on the same branch, but which should be able to run
# concurrently.
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
cancel-in-progress: true
env:
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
Expand All @@ -57,7 +56,7 @@ jobs:
- name: Test citool
# Only test citool on the auto branch, to reduce latency of the calculate matrix job
# on PR/try builds.
if: ${{ github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto' }}
if: ${{ github.ref == 'refs/heads/automation/bors/auto' }}
run: |
cd src/ci/citool
CARGO_INCREMENTAL=0 cargo test
Expand All @@ -80,7 +79,7 @@ jobs:
# access the environment.
#
# We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
env:
CI_JOB_NAME: ${{ matrix.name }}
CI_JOB_DOC_URL: ${{ matrix.doc_url }}
Expand Down Expand Up @@ -314,7 +313,7 @@ jobs:
needs: [ calculate_matrix, job ]
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
steps:
- name: checkout the source code
uses: actions/checkout@v5
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/attributes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub(crate) mod pin_v2;
pub(crate) mod proc_macro_attrs;
pub(crate) mod prototype;
pub(crate) mod repr;
pub(crate) mod rustc_dump;
pub(crate) mod rustc_internal;
pub(crate) mod semantics;
pub(crate) mod stability;
Expand Down
62 changes: 62 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
use rustc_hir::Target;
use rustc_hir::attrs::AttributeKind;
use rustc_span::{Span, Symbol, sym};

use crate::attributes::prelude::Allow;
use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
use crate::context::Stage;
use crate::target_checking::AllowedTargets;

pub(crate) struct RustcDumpUserArgs;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpUserArgs {
const PATH: &[Symbol] = &[sym::rustc_dump_user_args];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpUserArgs;
}

pub(crate) struct RustcDumpDefParents;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpDefParents {
const PATH: &[Symbol] = &[sym::rustc_dump_def_parents];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpDefParents;
}

pub(crate) struct RustcDumpItemBounds;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpItemBounds {
const PATH: &[Symbol] = &[sym::rustc_dump_item_bounds];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::AssocTy)]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpItemBounds;
}

pub(crate) struct RustcDumpPredicates;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpPredicates {
const PATH: &[Symbol] = &[sym::rustc_dump_predicates];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::Struct),
Allow(Target::Enum),
Allow(Target::Union),
Allow(Target::Trait),
Allow(Target::AssocTy),
]);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpPredicates;
}

pub(crate) struct RustcDumpVtable;

impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpVtable {
const PATH: &[Symbol] = &[sym::rustc_dump_vtable];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::Impl { of_trait: true }),
Allow(Target::TyAlias),
]);
const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcDumpVtable;
}
9 changes: 9 additions & 0 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ use crate::attributes::proc_macro_attrs::{
};
use crate::attributes::prototype::CustomMirParser;
use crate::attributes::repr::{AlignParser, AlignStaticParser, ReprParser};
use crate::attributes::rustc_dump::{
RustcDumpDefParents, RustcDumpItemBounds, RustcDumpPredicates, RustcDumpUserArgs,
RustcDumpVtable,
};
use crate::attributes::rustc_internal::{
RustcHasIncoherentInherentImplsParser, RustcLayoutScalarValidRangeEndParser,
RustcLayoutScalarValidRangeStartParser, RustcLegacyConstGenericsParser,
Expand Down Expand Up @@ -267,6 +271,11 @@ attribute_parsers!(
Single<WithoutArgs<ProcMacroParser>>,
Single<WithoutArgs<PubTransparentParser>>,
Single<WithoutArgs<RustcCoherenceIsCoreParser>>,
Single<WithoutArgs<RustcDumpDefParents>>,
Single<WithoutArgs<RustcDumpItemBounds>>,
Single<WithoutArgs<RustcDumpPredicates>>,
Single<WithoutArgs<RustcDumpUserArgs>>,
Single<WithoutArgs<RustcDumpVtable>>,
Single<WithoutArgs<RustcHasIncoherentInherentImplsParser>>,
Single<WithoutArgs<RustcLintDiagnosticsParser>>,
Single<WithoutArgs<RustcLintOptTyParser>>,
Expand Down
15 changes: 15 additions & 0 deletions compiler/rustc_hir/src/attrs/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,21 @@ pub enum AttributeKind {
/// Represents `#[rustc_coherence_is_core]`
RustcCoherenceIsCore(Span),

/// Represents `#[rustc_dump_def_parents]`
RustcDumpDefParents,

/// Represents `#[rustc_dump_item_bounds]`
RustcDumpItemBounds,

/// Represents `#[rustc_dump_predicates]`
RustcDumpPredicates,

/// Represents `#[rustc_dump_user_args]`
RustcDumpUserArgs,

/// Represents `#[rustc_dump_vtable]`
RustcDumpVtable(Span),

/// Represents `#[rustc_has_incoherent_inherent_impls]`
RustcHasIncoherentInherentImpls,

Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_hir/src/attrs/encode_cross_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ impl AttributeKind {
Repr { .. } => No,
RustcBuiltinMacro { .. } => Yes,
RustcCoherenceIsCore(..) => No,
RustcDumpDefParents => No,
RustcDumpItemBounds => No,
RustcDumpPredicates => No,
RustcDumpUserArgs => No,
RustcDumpVtable(..) => No,
RustcHasIncoherentInherentImpls => Yes,
RustcLayoutScalarValidRangeEnd(..) => Yes,
RustcLayoutScalarValidRangeStart(..) => Yes,
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir_analysis/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ hir_analysis_duplicate_precise_capture = cannot capture parameter `{$name}` twic
.label = parameter captured again here

hir_analysis_eii_with_generics =
#[{$eii_name}] cannot have generic parameters other than lifetimes
`{$impl_name}` cannot have generic parameters other than lifetimes
.label = required by this attribute
.help = `#[{$eii_name}]` marks the implementation of an "externally implementable item"

hir_analysis_empty_specialization = specialization impl does not specialize any associated items
.note = impl is a specialization of this impl
Expand Down
9 changes: 8 additions & 1 deletion compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,19 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
(0, _) => ("const", "consts", None),
_ => ("type or const", "types or consts", None),
};
let name =
if find_attr!(tcx.get_all_attrs(def_id), AttributeKind::EiiForeignItem) {
"externally implementable items"
} else {
"foreign items"
};

let span = tcx.def_span(def_id);
struct_span_code_err!(
tcx.dcx(),
span,
E0044,
"foreign items may not have {kinds} parameters",
"{name} may not have {kinds} parameters",
)
.with_span_label(span, format!("can't have {kinds} parameters"))
.with_help(
Expand Down
17 changes: 15 additions & 2 deletions compiler/rustc_hir_analysis/src/check/compare_eii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ use std::iter;

use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::{Applicability, E0806, struct_span_code_err};
use rustc_hir::attrs::{AttributeKind, EiiImplResolution};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::{self as hir, FnSig, HirId, ItemKind};
use rustc_hir::{self as hir, FnSig, HirId, ItemKind, find_attr};
use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt};
use rustc_infer::traits::{ObligationCause, ObligationCauseCode};
use rustc_middle::ty::error::{ExpectedFound, TypeError};
Expand Down Expand Up @@ -169,11 +170,23 @@ fn check_no_generics<'tcx>(
eii_attr_span: Span,
) -> Result<(), ErrorGuaranteed> {
let generics = tcx.generics_of(external_impl);
if generics.own_requires_monomorphization() {
if generics.own_requires_monomorphization()
// When an EII implementation is automatically generated by the `#[eii]` macro,
// it will directly refer to the foreign item, not through a macro.
// We don't want to emit this error if it's an implementation that's generated by the `#[eii]` macro,
// since in that case it looks like a duplicate error: the declaration of the EII already can't contain generics.
// So, we check here if at least one of the eii impls has ImplResolution::Macro, which indicates it's
// not generated as part of the declaration.
&& find_attr!(
tcx.get_all_attrs(external_impl),
AttributeKind::EiiImpls(impls) if impls.iter().any(|i| matches!(i.resolution, EiiImplResolution::Macro(_)))
)
{
tcx.dcx().emit_err(EiiWithGenerics {
span: tcx.def_span(external_impl),
attr: eii_attr_span,
eii_name,
impl_name: tcx.item_name(external_impl),
});
}

Expand Down
8 changes: 3 additions & 5 deletions compiler/rustc_hir_analysis/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ use rustc_trait_selection::traits::{
use tracing::{debug, instrument};

use crate::errors;
use crate::hir_ty_lowering::{
FeedConstTy, HirTyLowerer, InherentAssocCandidate, RegionInferReason,
};
use crate::hir_ty_lowering::{HirTyLowerer, InherentAssocCandidate, RegionInferReason};

pub(crate) mod dump;
mod generics_of;
Expand Down Expand Up @@ -1499,7 +1497,7 @@ fn const_param_default<'tcx>(

let ct = icx
.lowerer()
.lower_const_arg(default_ct, FeedConstTy::with_type_of(tcx, def_id, identity_args));
.lower_const_arg(default_ct, tcx.type_of(def_id).instantiate(tcx, identity_args));
ty::EarlyBinder::bind(ct)
}

Expand Down Expand Up @@ -1557,7 +1555,7 @@ fn const_of_item<'tcx>(
let identity_args = ty::GenericArgs::identity_for_item(tcx, def_id);
let ct = icx
.lowerer()
.lower_const_arg(ct_arg, FeedConstTy::with_type_of(tcx, def_id.to_def_id(), identity_args));
.lower_const_arg(ct_arg, tcx.type_of(def_id.to_def_id()).instantiate(tcx, identity_args));
if let Err(e) = icx.check_tainted_by_errors()
&& !ct.references_error()
{
Expand Down
28 changes: 15 additions & 13 deletions compiler/rustc_hir_analysis/src/collect/dump.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use rustc_hir as hir;
use rustc_hir::attrs::AttributeKind;
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
use rustc_hir::intravisit;
use rustc_hir::{find_attr, intravisit};
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt};
use rustc_span::sym;
Expand Down Expand Up @@ -28,7 +29,7 @@ pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) {

pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) {
for id in tcx.hir_crate_items(()).owners() {
if tcx.has_attr(id, sym::rustc_dump_predicates) {
if find_attr!(tcx.get_all_attrs(id), AttributeKind::RustcDumpPredicates) {
let preds = tcx.predicates_of(id).instantiate_identity(tcx).predicates;
let span = tcx.def_span(id);

Expand All @@ -38,7 +39,7 @@ pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) {
}
diag.emit();
}
if tcx.has_attr(id, sym::rustc_dump_item_bounds) {
if find_attr!(tcx.get_all_attrs(id), AttributeKind::RustcDumpItemBounds) {
let bounds = tcx.item_bounds(id).instantiate_identity();
let span = tcx.def_span(id);

Expand All @@ -54,7 +55,7 @@ pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) {
pub(crate) fn def_parents(tcx: TyCtxt<'_>) {
for iid in tcx.hir_free_items() {
let did = iid.owner_id.def_id;
if tcx.has_attr(did, sym::rustc_dump_def_parents) {
if find_attr!(tcx.get_all_attrs(did), AttributeKind::RustcDumpDefParents) {
struct AnonConstFinder<'tcx> {
tcx: TyCtxt<'tcx>,
anon_consts: Vec<LocalDefId>,
Expand Down Expand Up @@ -102,7 +103,9 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
for id in tcx.hir_free_items() {
let def_id = id.owner_id.def_id;

let Some(attr) = tcx.get_attr(def_id, sym::rustc_dump_vtable) else {
let Some(&attr_span) =
find_attr!(tcx.get_all_attrs(def_id), AttributeKind::RustcDumpVtable(span) => span)
else {
continue;
};

Expand All @@ -111,14 +114,14 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
let trait_ref = tcx.impl_trait_ref(def_id).instantiate_identity();
if trait_ref.has_non_region_param() {
tcx.dcx().span_err(
attr.span(),
attr_span,
"`rustc_dump_vtable` must be applied to non-generic impl",
);
continue;
}
if !tcx.is_dyn_compatible(trait_ref.def_id) {
tcx.dcx().span_err(
attr.span(),
attr_span,
"`rustc_dump_vtable` must be applied to dyn-compatible trait",
);
continue;
Expand All @@ -127,7 +130,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
.try_normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), trait_ref)
else {
tcx.dcx().span_err(
attr.span(),
attr_span,
"`rustc_dump_vtable` applied to impl header that cannot be normalized",
);
continue;
Expand All @@ -138,7 +141,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
let ty = tcx.type_of(def_id).instantiate_identity();
if ty.has_non_region_param() {
tcx.dcx().span_err(
attr.span(),
attr_span,
"`rustc_dump_vtable` must be applied to non-generic type",
);
continue;
Expand All @@ -147,14 +150,13 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
tcx.try_normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), ty)
else {
tcx.dcx().span_err(
attr.span(),
attr_span,
"`rustc_dump_vtable` applied to type alias that cannot be normalized",
);
continue;
};
let ty::Dynamic(data, _) = *ty.kind() else {
tcx.dcx()
.span_err(attr.span(), "`rustc_dump_vtable` to type alias of dyn type");
tcx.dcx().span_err(attr_span, "`rustc_dump_vtable` to type alias of dyn type");
continue;
};
if let Some(principal) = data.principal() {
Expand All @@ -167,7 +169,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
}
_ => {
tcx.dcx().span_err(
attr.span(),
attr_span,
"`rustc_dump_vtable` only applies to impl, or type alias of dyn type",
);
continue;
Expand Down
Loading
Loading