Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5a98077
Mention `@bors squash` in squashing documentation
Kobzol Feb 28, 2026
1ec1e10
Merge pull request #2785 from Kobzol/bors-squash
Kobzol Mar 1, 2026
0b9fb67
Prepare for merging from rust-lang/rust
invalid-email-address Mar 2, 2026
aa57821
Merge ref 'e7d90c695a39' from rust-lang/rust
invalid-email-address Mar 2, 2026
22a111a
Merge pull request #2787 from rust-lang/rustc-pull
tshepang Mar 2, 2026
1f94e97
Fix some comments about dataflow analysis.
nnethercote Oct 22, 2025
fcfd96e
Fix LegacyKeyValueFormat report from docker build: pr
homersimpsons Mar 7, 2026
aabb3d8
Update query documentation to reflect QueryKey changes
reddevilmidzy Mar 8, 2026
25dcaa1
Merge pull request #2790 from reddevilmidzy/query
reddevilmidzy Mar 8, 2026
bf4004a
Update conventions for TODO and FIXME comments
reddevilmidzy Mar 8, 2026
d1f5438
Merge pull request #2789 from reddevilmidzy/todo-fixme
tshepang Mar 8, 2026
c159475
Fix typo in feature gate check
reddevilmidzy Mar 9, 2026
e4d4287
Merge pull request #2791 from rust-lang/fix
reddevilmidzy Mar 9, 2026
91c3763
Prepare for merging from rust-lang/rust
invalid-email-address Mar 9, 2026
5e98580
Merge ref 'eda4fc7733ee' from rust-lang/rust
invalid-email-address Mar 9, 2026
0f3f57f
Merge pull request #2792 from rust-lang/rustc-pull
tshepang Mar 9, 2026
752f75d
document that older LLVM versions come with increased risk
RalfJung Mar 9, 2026
903ecb4
Merge pull request #2793 from RalfJung/llvm
tshepang Mar 9, 2026
a5f88c7
add autodiff download instructions
ZuseZ4 Mar 10, 2026
5cbdf84
Merge pull request #2788 from rust-lang/update-autodiff-installation
ZuseZ4 Mar 10, 2026
4bd7718
Remove emoji :)
reddevilmidzy Mar 10, 2026
16050b6
Merge pull request #2794 from rust-lang/reddevilmidzy-patch-1
reddevilmidzy Mar 10, 2026
9fcec02
unused_macro_rules switched used and unused comments
ralpha Mar 11, 2026
c909ae5
add test that an incomplete feature emits a warning
cyrgani Mar 11, 2026
db26b5b
editorconfig: css uses tabs
lolbinarycat Mar 11, 2026
5e305ab
sembr src/backend/updating-llvm.md
tshepang Mar 12, 2026
5de87cd
sembr src/diagnostics/translation.md
tshepang Mar 12, 2026
7963b55
sembr src/git.md
tshepang Mar 12, 2026
751562f
sembr src/tracing.md
tshepang Mar 12, 2026
da4f9a7
Merge pull request #2795 from rust-lang/tshepang/sembr
tshepang Mar 12, 2026
cfcbcb7
fix(query): Pass query key to value_from_cycle_error
TKanX Mar 11, 2026
3464048
test(parallel): Add regression test for #153391
TKanX Mar 11, 2026
ac062fd
Allow auto jobs to be non-blocking
Kobzol Mar 11, 2026
96e4833
Add new CI job that runs tests with a toolchain built with multiple t…
Kobzol Mar 12, 2026
b3333b3
Document optional auto jobs in the rustc-dev-guide
Kobzol Mar 12, 2026
687d7db
actually make the is-fn test test what it says it tests
jdonszelmann Mar 12, 2026
0670491
Don't add empty target features for target-cpu=native on macOS
nikic Mar 12, 2026
4003c4d
Rollup merge of #153726 - Kobzol:parallel-frontend-tests-optional, r=…
Zalathar Mar 12, 2026
df5190c
Rollup merge of #153763 - nikic:target-cpu-native-fix, r=lqd
Zalathar Mar 12, 2026
bb8ef9b
Rollup merge of #153432 - nnethercote:dataflow-comments, r=cjgillot
Zalathar Mar 12, 2026
d0a5038
Rollup merge of #153529 - homersimpsons:chore/fix-LegacyKeyValueForma…
Zalathar Mar 12, 2026
332aabe
Rollup merge of #153694 - TKanX:bugfix/153391-cycle-error-key-param, …
Zalathar Mar 12, 2026
d3d3522
Rollup merge of #153717 - ralpha:unused_macro_rules-lint-correction, …
Zalathar Mar 12, 2026
aa54aec
Rollup merge of #153736 - cyrgani:incomplete-2, r=fmease
Zalathar Mar 12, 2026
c6aea9a
Rollup merge of #153748 - lolbinarycat:editorconfig-css, r=jieyouxu
Zalathar Mar 12, 2026
a7c2aea
Rollup merge of #153750 - tshepang:rdg-sync, r=tshepang
Zalathar Mar 12, 2026
9205034
Rollup merge of #153762 - jdonszelmann:is-fn-test, r=lcnr
Zalathar Mar 12, 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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.css]
indent_style = tab

# some tests need trailing whitespace in output snapshots
[tests/**]
trim_trailing_whitespace = false
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,9 @@ pub(crate) fn global_llvm_features(sess: &Session, only_base_features: bool) ->

features_string
};
features.extend(features_string.split(',').map(String::from));
if !features_string.is_empty() {
features.extend(features_string.split(',').map(String::from));
}
}
Some(_) | None => {}
};
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ declare_features! (
(internal, rustc_attrs, "1.0.0", None),
/// Allows using the `#[stable]` and `#[unstable]` attributes.
(internal, staged_api, "1.0.0", None),
/// Perma-unstable, only used to test the `incomplete_features` lint.
(incomplete, test_incomplete_feature, "CURRENT_RUSTC_VERSION", None),
/// Added for testing unstable lints; perma-unstable.
(internal, test_unstable_lint, "1.60.0", None),
/// Use for stable + negative coherence and strict coherence depending on trait's
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,8 @@ declare_lint! {
/// ```rust
/// #[warn(unused_macro_rules)]
/// macro_rules! unused_empty {
/// (hello) => { println!("Hello, world!") }; // This rule is unused
/// () => { println!("empty") }; // This rule is used
/// (hello) => { println!("Hello, world!") }; // This rule is used
/// () => { println!("empty") }; // This rule is unused
/// }
///
/// fn main() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/basic_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'tcx> BasicBlocks<'tcx> {

/// Returns basic blocks in a reverse postorder.
///
/// See [`traversal::reverse_postorder`]'s docs to learn what is preorder traversal.
/// See [`traversal::reverse_postorder`]'s docs to learn what is postorder traversal.
///
/// [`traversal::reverse_postorder`]: crate::mir::traversal::reverse_postorder
#[inline]
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_middle/src/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ pub struct QueryVTable<'tcx, C: QueryCache> {
/// For `no_hash` queries, this function pointer is None.
pub hash_value_fn: Option<fn(&mut StableHashingContext<'_>, &C::Value) -> Fingerprint>,

pub value_from_cycle_error:
fn(tcx: TyCtxt<'tcx>, cycle_error: CycleError, guar: ErrorGuaranteed) -> C::Value,
pub value_from_cycle_error: fn(
tcx: TyCtxt<'tcx>,
key: C::Key,
cycle_error: CycleError,
guar: ErrorGuaranteed,
) -> C::Value,
pub format_value: fn(&C::Value) -> String,

/// Formats a human-readable description of this query and its key, as
Expand Down
54 changes: 28 additions & 26 deletions compiler/rustc_mir_dataflow/src/impls/initialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,21 @@ impl<'tcx> MaybePlacesSwitchIntData<'tcx> {
/// ```rust
/// struct S;
/// #[rustfmt::skip]
/// fn foo(pred: bool) { // maybe-init:
/// // {}
/// let a = S; let mut b = S; let c; let d; // {a, b}
/// fn foo(p: bool) { // maybe-init:
/// // {p}
/// let a = S; let mut b = S; let c; let d; // {p, a, b}
///
/// if pred {
/// drop(a); // { b}
/// b = S; // { b}
/// if p {
/// drop(a); // {p, b}
/// b = S; // {p, b}
///
/// } else {
/// drop(b); // {a}
/// d = S; // {a, d}
/// drop(b); // {p, a}
/// d = S; // {p, a, d}
///
/// } // {a, b, d}
/// } // {p, a, b, d}
///
/// c = S; // {a, b, c, d}
/// c = S; // {p, a, b, c, d}
/// }
/// ```
///
Expand Down Expand Up @@ -199,11 +199,11 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeInitializedPlaces<'a, 'tcx> {
/// ```rust
/// struct S;
/// #[rustfmt::skip]
/// fn foo(pred: bool) { // maybe-uninit:
/// fn foo(p: bool) { // maybe-uninit:
/// // {a, b, c, d}
/// let a = S; let mut b = S; let c; let d; // { c, d}
///
/// if pred {
/// if p {
/// drop(a); // {a, c, d}
/// b = S; // {a, c, d}
///
Expand Down Expand Up @@ -279,34 +279,36 @@ impl<'tcx> HasMoveData<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
}
}

/// `EverInitializedPlaces` tracks all places that might have ever been
/// initialized upon reaching a particular point in the control flow
/// for a function, without an intervening `StorageDead`.
/// `EverInitializedPlaces` tracks all initializations that may have occurred
/// upon reaching a particular point in the control flow for a function,
/// without an intervening `StorageDead`.
///
/// This dataflow is used to determine if an immutable local variable may
/// be assigned to.
///
/// For example, in code like the following, we have corresponding
/// dataflow information shown in the right-hand comments.
/// dataflow information shown in the right-hand comments. Underscored indices
/// are used to distinguish between multiple initializations of the same local
/// variable, e.g. `b_0` and `b_1`.
///
/// ```rust
/// struct S;
/// #[rustfmt::skip]
/// fn foo(pred: bool) { // ever-init:
/// // { }
/// let a = S; let mut b = S; let c; let d; // {a, b }
/// fn foo(p: bool) { // ever-init:
/// // {p, }
/// let a = S; let mut b = S; let c; let d; // {p, a, b_0, }
///
/// if pred {
/// drop(a); // {a, b, }
/// b = S; // {a, b, }
/// if p {
/// drop(a); // {p, a, b_0, }
/// b = S; // {p, a, b_0, b_1, }
///
/// } else {
/// drop(b); // {a, b, }
/// d = S; // {a, b, d }
/// drop(b); // {p, a, b_0, b_1, }
/// d = S; // {p, a, b_0, b_1, d}
///
/// } // {a, b, d }
/// } // {p, a, b_0, b_1, d}
///
/// c = S; // {a, b, c, d }
/// c = S; // {p, a, b_0, b_1, c, d}
/// }
/// ```
pub struct EverInitializedPlaces<'a, 'tcx> {
Expand Down
12 changes: 7 additions & 5 deletions compiler/rustc_query_impl/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,18 @@ where
fn mk_cycle<'tcx, C: QueryCache>(
query: &'tcx QueryVTable<'tcx, C>,
tcx: TyCtxt<'tcx>,
key: C::Key,
cycle_error: CycleError,
) -> C::Value {
let error = report_cycle(tcx.sess, &cycle_error);
match query.cycle_error_handling {
CycleErrorHandling::Error => {
let guar = error.emit();
(query.value_from_cycle_error)(tcx, cycle_error, guar)
(query.value_from_cycle_error)(tcx, key, cycle_error, guar)
}
CycleErrorHandling::DelayBug => {
let guar = error.delay_as_bug();
(query.value_from_cycle_error)(tcx, cycle_error, guar)
(query.value_from_cycle_error)(tcx, key, cycle_error, guar)
}
}
}
Expand Down Expand Up @@ -219,6 +220,7 @@ where
fn cycle_error<'tcx, C: QueryCache>(
query: &'tcx QueryVTable<'tcx, C>,
tcx: TyCtxt<'tcx>,
key: C::Key,
try_execute: QueryJobId,
span: Span,
) -> (C::Value, Option<DepNodeIndex>) {
Expand All @@ -229,7 +231,7 @@ fn cycle_error<'tcx, C: QueryCache>(
.expect("failed to collect active queries");

let error = find_cycle_in_stack(try_execute, job_map, &current_query_job(), span);
(mk_cycle(query, tcx, error.lift()), None)
(mk_cycle(query, tcx, key, error.lift()), None)
}

#[inline(always)]
Expand Down Expand Up @@ -274,7 +276,7 @@ fn wait_for_query<'tcx, C: QueryCache>(

(v, Some(index))
}
Err(cycle) => (mk_cycle(query, tcx, cycle.lift()), None),
Err(cycle) => (mk_cycle(query, tcx, key, cycle.lift()), None),
}
}

Expand Down Expand Up @@ -337,7 +339,7 @@ fn try_execute_query<'tcx, C: QueryCache, const INCR: bool>(

// If we are single-threaded we know that we have cycle error,
// so we just return the error.
cycle_error(query, tcx, id, span)
cycle_error(query, tcx, key, id, span)
}
}
ActiveKeyStatus::Poisoned => FatalError.raise(),
Expand Down
25 changes: 11 additions & 14 deletions compiler/rustc_query_impl/src/from_cycle_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@ use rustc_middle::query::erase::erase_val;
use rustc_middle::ty::layout::{LayoutError, TyAndLayout};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::{bug, span_bug};
use rustc_span::def_id::LocalDefId;
use rustc_span::def_id::{DefId, LocalDefId};
use rustc_span::{ErrorGuaranteed, Span};

use crate::job::report_cycle;

pub(crate) fn specialize_query_vtables<'tcx>(vtables: &mut QueryVTables<'tcx>) {
vtables.type_of.value_from_cycle_error =
|tcx, _, guar| erase_val(ty::EarlyBinder::bind(Ty::new_error(tcx, guar)));
|tcx, _, _, guar| erase_val(ty::EarlyBinder::bind(Ty::new_error(tcx, guar)));

vtables.type_of_opaque_hir_typeck.value_from_cycle_error =
|tcx, _, guar| erase_val(ty::EarlyBinder::bind(Ty::new_error(tcx, guar)));
|tcx, _, _, guar| erase_val(ty::EarlyBinder::bind(Ty::new_error(tcx, guar)));

vtables.erase_and_anonymize_regions_ty.value_from_cycle_error =
|tcx, _, guar| erase_val(Ty::new_error(tcx, guar));
|tcx, _, _, guar| erase_val(Ty::new_error(tcx, guar));

vtables.fn_sig.value_from_cycle_error = |tcx, cycle, guar| erase_val(fn_sig(tcx, cycle, guar));
vtables.fn_sig.value_from_cycle_error = |tcx, key, _, guar| erase_val(fn_sig(tcx, key, guar));

vtables.check_representability.value_from_cycle_error =
|tcx, cycle, guar| check_representability(tcx, cycle, guar);
|tcx, _, cycle, guar| check_representability(tcx, cycle, guar);

vtables.check_representability_adt_ty.value_from_cycle_error =
|tcx, cycle, guar| check_representability(tcx, cycle, guar);
|tcx, _, cycle, guar| check_representability(tcx, cycle, guar);

vtables.variances_of.value_from_cycle_error =
|tcx, cycle, guar| erase_val(variances_of(tcx, cycle, guar));
|tcx, _, cycle, guar| erase_val(variances_of(tcx, cycle, guar));

vtables.layout_of.value_from_cycle_error =
|tcx, cycle, guar| erase_val(layout_of(tcx, cycle, guar));
|tcx, _, cycle, guar| erase_val(layout_of(tcx, cycle, guar));
}

pub(crate) fn default<'tcx>(tcx: TyCtxt<'tcx>, cycle_error: CycleError, query_name: &str) -> ! {
Expand All @@ -57,15 +57,12 @@ pub(crate) fn default<'tcx>(tcx: TyCtxt<'tcx>, cycle_error: CycleError, query_na

fn fn_sig<'tcx>(
tcx: TyCtxt<'tcx>,
cycle_error: CycleError,
def_id: DefId,
guar: ErrorGuaranteed,
) -> ty::EarlyBinder<'tcx, ty::PolyFnSig<'tcx>> {
let err = Ty::new_error(tcx, guar);

let arity = if let Some(info) = cycle_error.cycle.get(0)
&& info.frame.dep_kind == DepKind::fn_sig
&& let Some(def_id) = info.frame.def_id
&& let Some(node) = tcx.hir_get_if_local(def_id)
let arity = if let Some(node) = tcx.hir_get_if_local(def_id)
&& let Some(sig) = node.fn_sig()
{
sig.decl.inputs.len()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_impl/src/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ macro_rules! define_queries {
#[cfg(not($cache_on_disk))]
is_loadable_from_disk_fn: |_tcx, _key, _index| false,

value_from_cycle_error: |tcx, cycle, _| {
value_from_cycle_error: |tcx, _, cycle, _| {
$crate::from_cycle_error::default(tcx, cycle, stringify!($name))
},

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,7 @@ symbols! {
test_2018_feature,
test_accepted_feature,
test_case,
test_incomplete_feature,
test_removed_feature,
test_runner,
test_unstable_lint,
Expand Down
10 changes: 6 additions & 4 deletions src/ci/citool/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,14 @@ fn validate_job_database(db: &JobDatabase) -> anyhow::Result<()> {
equivalent_modulo_carve_out(pr_job, auto_job)?;
}

// Auto CI jobs must all "fail-fast" to avoid wasting Auto CI resources. For instance, `tidy`.
// Auto CI should "fail-fast" to avoid wasting Auto CI resources.
// However, some experimental auto jobs can be made optional, for example if we are unsure about
// their flakiness. Those have to be prefixed with `optional-`.
for auto_job in &db.auto_jobs {
if auto_job.continue_on_error == Some(true) {
if auto_job.continue_on_error == Some(true) && !auto_job.name.starts_with("optional-") {
return Err(anyhow!(
"Auto job `{}` cannot have `continue_on_error: true`",
auto_job.name
"Auto job `{job}` cannot have `continue_on_error: true`. If the job should be optional, name it `optional-{job}`.",
job = auto_job.name
));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
sudo \
gdb \
libssl-dev \
pkg-config \
xz-utils \
mingw-w64 \
zlib1g-dev \
libzstd-dev \
&& rm -rf /var/lib/apt/lists/*

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--enable-sanitizers \
--enable-profiler \
--enable-compiler-docs \
--set llvm.libzstd=true

# Build the toolchain with multiple parallel frontend threads and then run tests
# Tests are still compiled serially at the moment (intended to be changed in follow-ups).
ENV SCRIPT python3 ../x.py --stage 2 test --set rust.parallel-frontend-threads=4
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/pr-check-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY host-x86_64/pr-check-1/validate-toolstate.sh /scripts/
# Check library crates on all tier 1 targets.
# We disable optimized compiler built-ins because that requires a C toolchain for the target.
# We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs.
ENV SCRIPT \
ENV SCRIPT=" \
# Check some tools that aren't included in `x check` by default, to
# ensure that maintainers can still do check builds locally.
python3 ../x.py check \
Expand All @@ -58,4 +58,4 @@ ENV SCRIPT \
python3 ../x.py check --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \
/scripts/validate-toolstate.sh && \
reuse --include-submodules lint && \
python3 ../x.py test collect-license-metadata
python3 ../x.py test collect-license-metadata"
5 changes: 2 additions & 3 deletions src/ci/docker/host-x86_64/pr-check-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ ENV RUST_CONFIGURE_ARGS="--set rust.validate-mir-opts=3"
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV SCRIPT \
python3 ../x.py check && \
ENV SCRIPT="python3 ../x.py check && \
python3 ../x.py clippy ci --stage 2 && \
python3 ../x.py test --stage 1 core alloc std test proc_macro && \
# Elsewhere, we run all tests for the host. A number of codegen tests are sensitive to the target pointer
Expand All @@ -48,4 +47,4 @@ ENV SCRIPT \
RUSTDOCFLAGS=\"--document-private-items --document-hidden-items\" python3 ../x.py doc library/test --stage 1 && \
# The BOOTSTRAP_TRACING flag is added to verify whether the
# bootstrap process compiles successfully with this flag enabled.
BOOTSTRAP_TRACING=1 python3 ../x.py --help
BOOTSTRAP_TRACING=1 python3 ../x.py --help"
4 changes: 2 additions & 2 deletions src/ci/docker/host-x86_64/tidy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ COPY host-x86_64/pr-check-1/validate-toolstate.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck
ENV SCRIPT="TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck"
Loading
Loading