Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
70f1868
Add CI workflow to publish backtrace after a push to main
Kobzol Nov 11, 2026
a3d000e
Harden bash code
Kobzol Nov 11, 2026
a81886c
Set environment variables for the `gh` command
Kobzol Nov 11, 2026
e451490
Report a recursion limit error instead of delaying a bug in RPITIT co…
bit-aloo Nov 12, 2026
7674cda
Add test for self-referential RTN impl returning a concrete type
bit-aloo Nov 12, 2026
720dcc6
Check if crate version alraedy exists on crates.io
Kobzol Nov 13, 2026
9fe76f2
Avoid using Terminator:None in simplify_cfg
panstromek Nov 13, 2026
001c3f5
view-types: add test for view type unsizedness
scrabsha Nov 6, 2026
35a3474
view-types: fix view type pretty printing
scrabsha Nov 9, 2026
4d98bd6
Store comment content in a temporary directory
Kobzol Nov 14, 2026
26498e5
Use attribute parser for lang attributes in `LateResolutionVisitor`
JonathanBrouwer Nov 16, 2026
5cbb982
Add const generic transmute min support
xbwwj Nov 16, 2026
771b22f
bootstrap:fix keep-stage-std
xonx4l Nov 16, 2026
8f55c12
add regression test for re-exporting a private import of a primitive …
TaKO8Ki Nov 17, 2026
7bc94db
avoid ICE on re-exports of private imports without a `DefId`
TaKO8Ki Nov 17, 2026
ec54b14
Move ub_checks() inside the const_eval_select branch.
d0sboots Nov 18, 2026
421b1b2
fix ICE when a forced keyword follows a parameter pattern
programskillforverification Nov 18, 2026
1dd5f23
Added regression test.
TirushOne Nov 18, 2026
dd1ab82
Added TyCtx conveiniance method for getting the closure kind of a may…
TirushOne Oct 30, 2026
c510c13
Added new clearer error messages when when &FnOnce was provided when …
TirushOne Oct 30, 2026
c657c93
Move the publish logic into a separate Bash file
Kobzol Nov 18, 2026
ad4be69
bump some tools `toml` dependency
lqd Nov 18, 2026
bb05ffd
reflection: doc attributes from adts, fields, and variants
Tess4552 Oct 26, 2026
50557cc
Reword comments
Kobzol Nov 18, 2026
64b54df
Fix environment variable and shell config
Kobzol Nov 18, 2026
aee0a69
Move some initial-setup steps out of `run_tests`
Zalathar Nov 19, 2026
8e3c1c1
Move test-running and reporting out of `run_tests`, now `discover_tests`
Zalathar Nov 19, 2026
26361a3
Temporarily rename `lib.rs` to `discovery.rs`
Zalathar Nov 19, 2026
eaa2f71
Move all test-discovery code out of the crate root
Zalathar Nov 19, 2026
7b405ef
Small cleanups in `cli.rs`
Zalathar Nov 19, 2026
e60e073
Remove ebadf handling from stdio
ChrisDenton Nov 17, 2026
9222601
Windows ignore stdio to NUL
ChrisDenton Nov 17, 2026
80b557c
Add regression test
JonathanBrouwer Nov 18, 2026
354c2ef
Don't recover if not allowed in `parse_seq_to_before_tokens`
JonathanBrouwer Nov 18, 2026
7e41a8e
simd-test: Fix cfg syntax in the test macro
tgross35 Nov 19, 2026
54e07ae
std: Constify `std::process::abort`
tgross35 Nov 19, 2026
433fb54
test zst and zero len
xbwwj Nov 19, 2026
7e291dc
test normalized
xbwwj Nov 19, 2026
2c42b4d
ref: avoid terminator: None in insert_direct_enum_check
panstromek Nov 19, 2026
dba4d78
add stamp for --keep-stage
xonx4l Nov 19, 2026
610d5c3
bootstrap: Make low priority the default
kotauskas Nov 9, 2026
d7bfe5e
refactor split_block in check_pointers to avoid Terminator: None
panstromek Nov 9, 2026
0c2fc3b
bootstrap: `job.rs` improvements
kotauskas Nov 19, 2026
1f1307f
Rollup merge of #165707 - kotauskas:low-prio-by-default, r=clubby789
jhpratt Nov 20, 2026
36505fb
Rollup merge of #165716 - panstromek:no-terminato-option-split-block,…
jhpratt Nov 20, 2026
d871479
Rollup merge of #165934 - panstromek:no-terminator-none-in-simplify-c…
jhpratt Nov 20, 2026
df9fdd9
Rollup merge of #166050 - JonathanBrouwer:lang_attr_parser, r=fmease
jhpratt Nov 20, 2026
2b67f7a
Rollup merge of #166069 - xonx4l:fix-keep-stage-std, r=Kobzol
jhpratt Nov 20, 2026
b41b142
Rollup merge of #166117 - ChrisDenton:ebadf, r=maxdexh
jhpratt Nov 20, 2026
e697912
Rollup merge of #166119 - TaKO8Ki:fix-reexport-primty-ice, r=mati865
jhpratt Nov 20, 2026
93560c3
Rollup merge of #165094 - Tess4552:reflection-type-id-docs, r=oli-obk
jhpratt Nov 20, 2026
7c204ef
Rollup merge of #165216 - TirushOne:issue-47648-fix, r=oli-obk
jhpratt Nov 20, 2026
cea368b
Rollup merge of #165694 - scrabsha:view-types/unsizedness, r=oli-obk
jhpratt Nov 20, 2026
b6152e7
Rollup merge of #165802 - Kobzol:publish-crates, r=workingjubilee,jie…
jhpratt Nov 20, 2026
5aefbc2
Rollup merge of #165883 - bit-aloo:2026-11-12-rpitit-refine-recursion…
jhpratt Nov 20, 2026
cf58db9
Rollup merge of #165906 - programskillforverification:forced-kw-param…
jhpratt Nov 20, 2026
78b176f
Rollup merge of #166064 - xbwwj:cg-transmute-arr, r=oli-obk
jhpratt Nov 20, 2026
33dce19
Rollup merge of #166136 - d0sboots:assert_ub, r=RalfJung
jhpratt Nov 20, 2026
cc3a012
Rollup merge of #166158 - lqd:toml-bump, r=Kobzol
jhpratt Nov 20, 2026
861f46c
Rollup merge of #166166 - JonathanBrouwer:recovery1, r=oli-obk
jhpratt Nov 20, 2026
852cc7f
Rollup merge of #166176 - Zalathar:discover, r=jieyouxu
jhpratt Nov 20, 2026
6eef829
Rollup merge of #166185 - tgross35:simd-test-macro, r=RalfJung
jhpratt Nov 20, 2026
bb83529
Rollup merge of #166194 - tgross35:const-abort, r=clarfonthey,RalfJung
jhpratt Nov 20, 2026
57bce7d
Rollup merge of #166210 - panstromek:no-terminator-option-in-check-en…
jhpratt Nov 20, 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
36 changes: 32 additions & 4 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Workflow that runs after a merge to the default branch, analyses changes in test executions
# and posts the result to the merged PR.
# Workflow that runs after a merge to the default branch.
# It performs two things:
# 1) Analyses changes in test executions and posts the result to the merged PR.
# 2) Performs a cargo publish on crates published from the `rust-lang/rust` repository, and if a
# publish happened, post the result to the merged PR.

name: Post merge analysis
name: Post merge workflow

on:
push:
Expand All @@ -13,14 +16,15 @@ jobs:
runs-on: ubuntu-26.04
if: github.repository == 'rust-lang/rust'
permissions:
pull-requests: write
pull-requests: write # For sending a PR comment
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Make sure that we have enough commits to find the parent merge commit.
# Since all merges should be through merge commits, fetching two commits
# should be enough to get the parent bors merge commit.
fetch-depth: 2
persist-credentials: false
- name: Perform analysis and send PR
env:
GH_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -51,3 +55,27 @@ jobs:
cat output.log

gh pr comment ${HEAD_PR} -F output.log
publish:
runs-on: ubuntu-26.04
if: github.repository == 'rust-lang/rust'
environment: publish-crates-io
permissions:
id-token: write # For OIDC crates.io publishing
pull-requests: write # For sending a PR comment
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: rust-lang/crates-io-auth-action@3268eb413133e2960fa4ae0e963ca76380c54cd9 # v1.0.6
id: auth
- run: |
# Give GitHub some time to propagate the information that the PR was merged
sleep 60

# Publish backtrace
./src/ci/publish_backtrace.sh
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
GH_TOKEN: ${{ github.token }}
GITHUB_SHA: ${{ github.sha }}
TEMPDIR: ${{ runner.temp }}
40 changes: 3 additions & 37 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ dependencies = [
"serde_json",
"sha2",
"tar",
"toml 0.7.8",
"toml 0.8.23",
"xz2",
]

Expand Down Expand Up @@ -5780,7 +5780,7 @@ dependencies = [
"similar",
"tempfile",
"termcolor",
"toml 0.7.8",
"toml 0.8.23",
"walkdir",
]

Expand Down Expand Up @@ -5824,18 +5824,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"

[[package]]
name = "toml"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257"
dependencies = [
"serde",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
"toml_edit 0.19.15",
]

[[package]]
name = "toml"
version = "0.8.23"
Expand All @@ -5845,7 +5833,7 @@ dependencies = [
"serde",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
"toml_edit 0.22.27",
"toml_edit",
]

[[package]]
Expand Down Expand Up @@ -5881,19 +5869,6 @@ dependencies = [
"serde_core",
]

[[package]]
name = "toml_edit"
version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
"indexmap",
"serde",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
"winnow 0.5.40",
]

[[package]]
name = "toml_edit"
version = "0.22.27"
Expand Down Expand Up @@ -6776,15 +6751,6 @@ dependencies = [
"windows-link 0.2.1",
]

[[package]]
name = "winnow"
version = "0.5.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
dependencies = [
"memchr",
]

[[package]]
name = "winnow"
version = "0.7.13"
Expand Down
10 changes: 7 additions & 3 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,13 @@
# linked or not.
#build.cargo-native-static = false

# Run the build with low priority, by setting the process group's "nice" value
# to +10 on Unix platforms, and by using a "low priority" job object on Windows.
#build.low-priority = false
# Run the build with low priority, by setting the process's "nice" value to +10
# on Unix platforms, and by using a "low priority" job object on Windows.
# This will improve the responsiveness of foreground tasks and will not slow the
# build down unless there are competing CPU-saturating jobs, so there is
# typically no reason to opt out of this behavior. See the discussion in
# https://github.com/rust-lang/rust/pull/165707 for more details.
#build.low-priority = true

# Arguments passed to the `./configure` script, used during distcheck. You
# probably won't fill this in but rather it's filled in by the `./configure`
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_ir/src/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ pub enum AttributeKind {
InstrumentFn(InstrumentFnAttr),

/// Represents `#[lang]`
Lang(LangItem),
Lang(LangItem, Span),

/// Represents `#[link]`.
Link(ThinVec<LinkEntry>, Span),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_ir/src/encode_cross_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl AttributeKind {
Inline(..) => false,
InstructionSet(..) => false,
InstrumentFn(..) => false,
Lang(item) => item.link_name().is_some(),
Lang(item, _) => item.link_name().is_some(),
Link(..) => false,
LinkName { .. } => false,
LinkOrdinal { .. } => false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl NoArgsAttributeParser for TrackCallerParser {
Target::Fn => {
// `#[track_caller]` is not valid on weak lang items because they are called via
// `extern` declarations and `#[track_caller]` would alter their ABI.
if let Some(item) = find_attr!(cx.parsed_attrs, Lang(item) => item)
if let Some(item) = find_attr!(cx.parsed_attrs, Lang(item, _) => item)
&& item.is_weak()
{
cx.emit_err(TrackCallerOnLangItem {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ impl SingleAttributeParser for LangParser {
let allowed_targets: &[_] = &[Allow(lang_item.target())];
cx.check_target(&format!(" = \"{name}\""), &AllowedTargets::AllowList(allowed_targets));

Some(AttributeKind::Lang(lang_item))
Some(AttributeKind::Lang(lang_item, cx.attr_span))
}
}

Expand All @@ -594,7 +594,7 @@ impl NoArgsAttributeParser for PanicHandlerParser {
const PATH: &[Symbol] = &[sym::panic_handler];
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::Lang(LangItem::PanicImpl);
const CREATE: fn(Span) -> AttributeKind = |s| AttributeKind::Lang(LangItem::PanicImpl, s);
}

pub(crate) struct RustcNounwindParser;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ fn handle_lang_items(
attrs: &[Attribute],
codegen_fn_attrs: &mut CodegenFnAttrs,
) {
let lang_item = find_attr!(attrs, Lang(lang) => lang);
let lang_item = find_attr!(attrs, Lang(lang, _) => lang);

// Weak lang items have the same semantics as "std internal" symbols in the
// sense that they're preserved through all our LTO passes and only
Expand Down
44 changes: 44 additions & 0 deletions compiler/rustc_const_eval/src/const_eval/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,50 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
};
}

sym::type_id_docs => {
let ty = ecx.read_type_id(&args[0])?;
let attrs = match ty.kind() {
ty::Adt(def, args)
if let Some(FieldInfo { base, variant_idx, field_idx, .. }) =
def.field_representing_type_info(ecx.tcx(), *args) =>
{
match base.kind() {
ty::Adt(base_def, _) => {
let field = &base_def.variants()[variant_idx].fields[field_idx];
Some(field.did)
}
ty::Tuple(_) => None,
_ => {
// only adts and tuples have fields
span_bug!(ecx.cur_span(), "expected adt or tuple type, got {ty}");
}
}
}
ty::Adt(def, _) => Some(def.did()),
_ => None,
};

ecx.write_doc_attributes(dest, attrs)?;
}

sym::type_id_variant_docs => {
let base = ecx.read_type_id(&args[0])?;

if let ty::Adt(def, _) = base.kind() {
let variant_idx = ecx.read_target_usize(&args[1])? as usize;
if variant_idx >= def.variants().len() {
throw_ub!(BoundsCheckFailed {
len: def.variants().len() as u64,
index: variant_idx as u64
});
}
let var = def.variant(VariantIdx::from_usize(variant_idx)).def_id;
ecx.write_doc_attributes(dest, Some(var))?;
} else {
span_bug!(ecx.cur_span(), "expected enum type, got {base}")
};
}

sym::type_id_variant_non_exhaustive => {
let base = ecx.read_type_id(&args[0])?;

Expand Down
43 changes: 42 additions & 1 deletion compiler/rustc_const_eval/src/const_eval/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ mod adt;
use std::borrow::Cow;

use rustc_abi::{ExternAbi, FieldIdx};
use rustc_attr_ir::AttrItem;
use rustc_attr_ir::Attribute::Tool;
use rustc_attr_ir::lang_items::LangItem;
use rustc_attr_ir::{AttrItem, Attribute, AttributeKind, HasAttrs};
use rustc_hir::intravisit::HirTyCtxt;
use rustc_lint_defs::{Reflectiveness, ToolOptions};
use rustc_middle::ty::layout::{HasTyCtxt, TyAndLayout};
use rustc_middle::ty::{self, FnHeader, FnSigKind, FnSigTys, ScalarInt, Ty, TyCtxt};
use rustc_span::def_id::DefId;
use rustc_span::{Symbol, span_bug, sym};

use crate::const_eval::CompileTimeMachine;
Expand Down Expand Up @@ -393,4 +394,44 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
)
})
}

pub(crate) fn write_doc_attributes(
&mut self,
place: &impl Writeable<'tcx, CtfeProvenance>,
def_id: Option<DefId>,
) -> InterpResult<'tcx> {
// only the doc comments of exported items are encoded in cross-crate metadata
// see `rustc_metadata::rmeta::encoder::EncodeContext::encode_attrs`
// this mirrors the check so that we return the same comments regardless of crate
let attrs = if let Some(d) = def_id
&& d.as_local().map_or(true, |d| {
!self.tcx.needs_metadata() || self.tcx.effective_visibilities(()).is_exported(d)
}) {
d.get_attrs(&self.tcx)
} else {
&[]
};

let docs = attrs
.iter()
.filter_map(|x| match x {
Attribute::Parsed(AttributeKind::DocComment { comment, .. }) => Some(*comment),
_ => None,
})
.collect::<Vec<Symbol>>();

self.allocate_fill_and_write_slice_ptr(place, docs.len() as _, |this, i, place| {
let doc = docs[i as usize];

let ptr = this.allocate_bytes_dedup(doc.as_str().as_bytes())?;

this.write_immediate(
Immediate::ScalarPair(
Scalar::from_pointer(ptr, this),
Scalar::from_target_usize(doc.as_str().len() as u64, this),
),
&place,
)
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use rustc_middle::ty::{
};
use rustc_span::def_id::ModId;
use rustc_span::{Span, span_bug};
use rustc_trait_selection::error_reporting::traits::suggest_new_overflow_limit;
use rustc_trait_selection::regions::InferCtxtRegionExt;
use rustc_trait_selection::traits::{ObligationCtxt, elaborate, normalize_param_env_or_error};

Expand Down Expand Up @@ -286,10 +287,12 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'tcx> {
&& self.tcx.is_impl_trait_in_trait(proj.kind)
{
if !self.tcx.recursion_limit().value_within_limit(self.depth) {
self.tcx.dcx().span_delayed_bug(
let mut err = self.tcx.dcx().struct_span_err(
self.tcx.def_span(proj.kind),
"recursion limit exceeded while collecting implied RPITIT bounds",
);
suggest_new_overflow_limit(self.tcx, &mut err);
err.emit();
return ControlFlow::Break(());
}
if self.types.insert(proj) {
Expand Down
22 changes: 22 additions & 0 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::trunc
| sym::type_id
| sym::type_id_array_len
| sym::type_id_docs
| sym::type_id_element_ty
| sym::type_id_eq
| sym::type_id_field_representing_type
Expand All @@ -169,6 +170,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::type_id_reflected_attrs
| sym::type_id_size_of
| sym::type_id_type_of
| sym::type_id_variant_docs
| sym::type_id_variant_name
| sym::type_id_variant_non_exhaustive
| sym::type_id_variant_reflected_attrs
Expand Down Expand Up @@ -323,6 +325,26 @@ pub(crate) fn check_intrinsic_type(
sym::type_id_variant_name => {
(0, 0, vec![type_id_ty(), tcx.types.usize], Ty::new_static_str(tcx))
}
sym::type_id_variant_docs => (
0,
0,
vec![type_id_ty(), tcx.types.usize],
Ty::new_imm_ref(
tcx,
tcx.lifetimes.re_static,
Ty::new_slice(tcx, Ty::new_static_str(tcx)),
),
),
sym::type_id_docs => (
0,
0,
vec![type_id_ty()],
Ty::new_imm_ref(
tcx,
tcx.lifetimes.re_static,
Ty::new_slice(tcx, Ty::new_static_str(tcx)),
),
),
sym::type_id_variant_non_exhaustive => {
(0, 0, vec![type_id_ty(), tcx.types.usize], tcx.types.bool)
}
Expand Down
Loading
Loading