Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7668154
triagebot: add autolabel for rustdoc JS files
AaryanAgrawal96 Jan 2, 2026
9c4ead6
Remove legacy homu `try` and `auto` branch mentions
Kobzol Jan 7, 2026
291d0a9
diagnostics: make implicit Sized bounds explicit in E0277
Daniel-B-Smith Jan 6, 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
feb44c3
Make `--print=check-cfg` output compatible `--check-cfg` arguments
Urgau Jan 8, 2026
dd2b0a8
Update compiletest for new `--print=check-cfg` output
Urgau Jan 8, 2026
d697b4d
Improve std::path::Path::join documentation
KaiTomotake Jan 4, 2026
e5dbb3b
armv7-unknown-linux-uclibceabihf.md: Fix build-toml syntax
3v1n0 Jan 13, 2026
1e69091
armv7-unknown-linux-uclibceabihf.md: Update toolchain download link
3v1n0 Jan 13, 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
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
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
e027ecd
feat: support arrays in type reflection
BD103 Jan 12, 2026
71f8ea9
refactor: move tuples type info ui test to coretest
BD103 Jan 13, 2026
bed95e8
Rollup merge of #150587 - add-rustdoc-js-autolabel, r=fmease
GuillaumeGomez Jan 13, 2026
dd8cb22
Rollup merge of #150677 - improve-doc, r=Mark-Simulacrum
GuillaumeGomez Jan 13, 2026
75c2a93
Rollup merge of #150737 - smithdb3/fix-150576, r=chenyukang
GuillaumeGomez Jan 13, 2026
2c94d39
Rollup merge of #150771 - remove-homu-branches, r=marcoieni
GuillaumeGomez Jan 13, 2026
602ea6a
Rollup merge of #150840 - print-check-cfg-rework-output, r=nnethercote
GuillaumeGomez Jan 13, 2026
fe192aa
Rollup merge of #150915 - eii-regression-test-149983, r=kivooeo
GuillaumeGomez Jan 13, 2026
ad2ccdf
Rollup merge of #151017 - rustc_dump, r=jdonszelmann
GuillaumeGomez Jan 13, 2026
324ed16
Rollup merge of #151019 - type-of-unsized, r=oli-obk
GuillaumeGomez Jan 13, 2026
662658c
Rollup merge of #151031 - reflect-arrays, r=oli-obk
GuillaumeGomez Jan 13, 2026
9752ec9
Rollup merge of #151043 - patch-1, r=ehuss
GuillaumeGomez Jan 13, 2026
915077f
Rollup merge of #151052 - add-test-ice-in-resolve, r=Kivooeo
GuillaumeGomez Jan 13, 2026
16df57b
Rollup merge of #151053 - reduce-gui-test-flakyness, r=jieyouxu
GuillaumeGomez Jan 13, 2026
47a06e3
Rollup merge of #151055 - mgca-arr, r=BoxyUwU
GuillaumeGomez 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
35 changes: 33 additions & 2 deletions compiler/rustc_const_eval/src/const_eval/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc_hir::LangItem;
use rustc_middle::mir::interpret::CtfeProvenance;
use rustc_middle::span_bug;
use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::{self, ScalarInt, Ty};
use rustc_middle::ty::{self, Const, ScalarInt, Ty};
use rustc_span::{Symbol, sym};

use crate::const_eval::CompileTimeMachine;
Expand Down Expand Up @@ -56,14 +56,21 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
self.write_tuple_fields(tuple_place, fields, ty)?;
variant
}
ty::Array(ty, len) => {
let (variant, variant_place) = downcast(sym::Array)?;
let array_place = self.project_field(&variant_place, FieldIdx::ZERO)?;

self.write_array_type_info(array_place, *ty, *len)?;

variant
}
// For now just merge all primitives into one `Leaf` variant with no data
ty::Uint(_) | ty::Int(_) | ty::Float(_) | ty::Char | ty::Bool => {
downcast(sym::Leaf)?.0
}
ty::Adt(_, _)
| ty::Foreign(_)
| ty::Str
| ty::Array(_, _)
| ty::Pat(_, _)
| ty::Slice(_)
| ty::RawPtr(..)
Expand Down Expand Up @@ -172,4 +179,28 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
}
interp_ok(())
}

pub(crate) fn write_array_type_info(
&mut self,
place: impl Writeable<'tcx, CtfeProvenance>,
ty: Ty<'tcx>,
len: Const<'tcx>,
) -> InterpResult<'tcx> {
// Iterate over all fields of `type_info::Array`.
for (field_idx, field) in
place.layout().ty.ty_adt_def().unwrap().non_enum_variant().fields.iter_enumerated()
{
let field_place = self.project_field(&place, field_idx)?;

match field.name {
// Write the `TypeId` of the array's elements to the `element_ty` field.
sym::element_ty => self.write_type_id(ty, &field_place)?,
// Write the length of the array to the `len` field.
sym::len => self.write_scalar(len.to_leaf(), &field_place)?,
other => span_bug!(self.tcx.def_span(field.did), "unimplemented field {other}"),
}
}

interp_ok(())
}
}
35 changes: 20 additions & 15 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,30 +765,35 @@ fn print_crate_info(
for (name, expected_values) in &sess.psess.check_config.expecteds {
use crate::config::ExpectedValues;
match expected_values {
ExpectedValues::Any => check_cfgs.push(format!("{name}=any()")),
ExpectedValues::Any => {
check_cfgs.push(format!("cfg({name}, values(any()))"))
}
ExpectedValues::Some(values) => {
if !values.is_empty() {
check_cfgs.extend(values.iter().map(|value| {
let mut values: Vec<_> = values
.iter()
.map(|value| {
if let Some(value) = value {
format!("{name}=\"{value}\"")
format!("\"{value}\"")
} else {
name.to_string()
"none()".to_string()
}
}))
} else {
check_cfgs.push(format!("{name}="))
}
})
.collect();

values.sort_unstable();

let values = values.join(", ");

check_cfgs.push(format!("cfg({name}, values({values}))"))
}
}
}

check_cfgs.sort_unstable();
if !sess.psess.check_config.exhaustive_names {
if !sess.psess.check_config.exhaustive_values {
println_info!("any()=any()");
} else {
println_info!("any()");
}
if !sess.psess.check_config.exhaustive_names
&& sess.psess.check_config.exhaustive_values
{
println_info!("cfg(any())");
}
for check_cfg in check_cfgs {
println_info!("{check_cfg}");
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
Loading
Loading