Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1fa165d
style: remove unneeded trailing commas
nyurik Feb 9, 2026
8c0a493
BikeshedGuaranteedNoDrop trait: add comments indicating that it can b…
RalfJung Feb 9, 2026
6546a98
Update books
rustbot Feb 9, 2026
e1ed3bf
Remove out-of-date comment.
nnethercote Feb 10, 2026
1c4661c
Derive `Clone` for `QueryLatch`.
nnethercote Feb 9, 2026
b6b6dc0
mGCA: add associated const type check in dyn arm
zedddie Feb 5, 2026
963f82d
mGCA: add associated const obligations in wfck
zedddie Feb 7, 2026
ec03e39
bless tests
zedddie Feb 9, 2026
066a935
Move parts of `rustc_query_system::query::job` to `rustc_middle::job`.
nnethercote Feb 9, 2026
923de04
Move `rustc_middle::query::values` to `rustc_query_impl`.
nnethercote Feb 10, 2026
a34317e
Move `report_cycle`.
nnethercote Feb 10, 2026
0ebd56e
Remove accidental const stability marker on a struct
oli-obk Dec 4, 2025
628c37a
Restrict the set of things that const stability can be applied
oli-obk Dec 4, 2025
475b9d9
Prevent const stability attrs from being applied to macros via the no…
oli-obk Feb 10, 2026
32e49a8
Reenable a GCI+mGCA+GCPT test case
fmease Feb 10, 2026
da80677
Fix typos and grammar in top-level and src/doc documentation
him2him2 Feb 10, 2026
4a01f22
Bump tvOS, visionOS and watchOS Aarch64 targets to tier 2
madsmtm Feb 10, 2026
4fa388c
Disable profiler runtime on tvOS and watchOS
madsmtm Feb 10, 2026
2194af9
Rollup merge of #152419 - nnethercote:mv-more-query-system-code, r=Za…
matthiaskrgr Feb 11, 2026
88eda64
Rollup merge of #152431 - oli-obk:limited_stability_attr, r=jdonszelmann
matthiaskrgr Feb 11, 2026
6c8bbfe
Rollup merge of #152436 - fmease:reenable-gci-test-case, r=mati865
matthiaskrgr Feb 11, 2026
92e3972
Rollup merge of #152021 - madsmtm:tvos-visionos-watchos-tier-2, r=she…
matthiaskrgr Feb 11, 2026
9a4ce0b
Rollup merge of #152146 - zedddie:mgca-improve-const-bindings-wfck, r…
matthiaskrgr Feb 11, 2026
dbb1c20
Rollup merge of #152372 - nyurik:clippy-rustc_trait_selection, r=mati865
matthiaskrgr Feb 11, 2026
336deba
Rollup merge of #152383 - RalfJung:BikeshedGuaranteedNoDrop, r=TaKO8Ki
matthiaskrgr Feb 11, 2026
e233a4e
Rollup merge of #152397 - rustbot:docs-update, r=ehuss
matthiaskrgr Feb 11, 2026
f195663
Rollup merge of #152441 - him2him2:fix-typos-docs, r=ehuss
matthiaskrgr Feb 11, 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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the Zulip stream is the best place to *ask* for help.

Documentation for contributing to the compiler or tooling is located in the [Guide to Rustc
Development][rustc-dev-guide], commonly known as the [rustc-dev-guide]. Documentation for the
standard library in the [Standard library developers Guide][std-dev-guide], commonly known as the [std-dev-guide].
standard library is in the [Standard library developers Guide][std-dev-guide], commonly known as the [std-dev-guide].

## Making changes to subtrees and submodules

Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4492,6 +4492,7 @@ name = "rustc_query_impl"
version = "0.0.0"
dependencies = [
"measureme",
"rustc_abi",
"rustc_data_structures",
"rustc_errors",
"rustc_hashes",
Expand All @@ -4501,7 +4502,9 @@ dependencies = [
"rustc_middle",
"rustc_query_system",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_thread_pool",
"tracing",
]

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ itself back on after some time).

### MSVC

MSVC builds of Rust additionally requires an installation of:
MSVC builds of Rust additionally require an installation of:

- Visual Studio 2022 (or later) build tools so `rustc` can use its linker. Older
Visual Studio versions such as 2019 *may* work but aren't actively tested.
Expand Down
8 changes: 4 additions & 4 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ Compatibility Notes
- [Check well-formedness of the source type's signature in fn pointer casts.](https://github.com/rust-lang/rust/pull/129021) This partly closes a soundness hole that comes when casting a function item to function pointer
- [Use equality instead of subtyping when resolving type dependent paths.](https://github.com/rust-lang/rust/pull/129073)
- Linking on macOS now correctly includes Rust's default deployment target. Due to a linker bug, you might have to pass `MACOSX_DEPLOYMENT_TARGET` or fix your `#[link]` attributes to point to the correct frameworks. See <https://github.com/rust-lang/rust/pull/129369>.
- [Rust will now correctly raise an error for `repr(Rust)` written on non-`struct`/`enum`/`union` items, since it previous did not have any effect.](https://github.com/rust-lang/rust/pull/129422)
- [Rust will now correctly raise an error for `repr(Rust)` written on non-`struct`/`enum`/`union` items, since it previously did not have any effect.](https://github.com/rust-lang/rust/pull/129422)
- The future incompatibility lint `deprecated_cfg_attr_crate_type_name` [has been made into a hard error](https://github.com/rust-lang/rust/pull/129670). It was used to deny usage of `#![crate_type]` and `#![crate_name]` attributes in `#![cfg_attr]`, which required a hack in the compiler to be able to change the used crate type and crate name after cfg expansion.
Users can use `--crate-type` instead of `#![cfg_attr(..., crate_type = "...")]` and `--crate-name` instead of `#![cfg_attr(..., crate_name = "...")]` when running `rustc`/`cargo rustc` on the command line.
Use of those two attributes outside of `#![cfg_attr]` continue to be fully supported.
Expand Down Expand Up @@ -1722,7 +1722,7 @@ Cargo
Compatibility Notes
-------------------
- We now [disallow setting some built-in cfgs via the command-line](https://github.com/rust-lang/rust/pull/126158) with the newly added [`explicit_builtin_cfgs_in_flags`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags) lint in order to prevent incoherent state, eg. `windows` cfg active but target is Linux based. The appropriate [`rustc` flag](https://doc.rust-lang.org/rustc/command-line-arguments.html) should be used instead.
- The standard library has a new implementation of `binary_search` which is significantly improves performance ([#128254](https://github.com/rust-lang/rust/pull/128254)). However when a sorted slice has multiple values which compare equal, the new implementation may select a different value among the equal ones than the old implementation.
- The standard library has a new implementation of `binary_search` which significantly improves performance ([#128254](https://github.com/rust-lang/rust/pull/128254)). However when a sorted slice has multiple values which compare equal, the new implementation may select a different value among the equal ones than the old implementation.
- [illumos/Solaris now sets `MSG_NOSIGNAL` when writing to sockets](https://github.com/rust-lang/rust/pull/128259). This avoids killing the process with SIGPIPE when writing to a closed socket, which matches the existing behavior on other UNIX targets.
- [Removes a problematic hack that always passed the --whole-archive linker flag for tests, which may cause linker errors for code accidentally relying on it.](https://github.com/rust-lang/rust/pull/128400)
- The WebAssembly target features `multivalue` and `reference-types` are now
Expand Down Expand Up @@ -1872,7 +1872,7 @@ These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Add a Rust-for Linux `auto` CI job to check kernel builds.](https://github.com/rust-lang/rust/pull/125209/)
- [Add a Rust-for-Linux `auto` CI job to check kernel builds.](https://github.com/rust-lang/rust/pull/125209/)

Version 1.80.1 (2024-08-08)
===========================
Expand Down Expand Up @@ -4510,7 +4510,7 @@ Compatibility Notes
saturating to `0` instead][89926]. In the real world the panic happened mostly
on platforms with buggy monotonic clock implementations rather than catching
programming errors like reversing the start and end times. Such programming
errors will now results in `0` rather than a panic.
errors will now result in `0` rather than a panic.
- In a future release we're planning to increase the baseline requirements for
the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love
your feedback in [PR #95026][95026].
Expand Down
15 changes: 14 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,20 @@ impl<S: Stage> AttributeParser<S> for ConstStabilityParser {
this.promotable = true;
}),
];
const ALLOWED_TARGETS: AllowedTargets = ALLOWED_TARGETS;
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::Fn),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Impl { of_trait: false }),
Allow(Target::Impl { of_trait: true }),
Allow(Target::Use), // FIXME I don't think this does anything?
Allow(Target::Const),
Allow(Target::AssocConst),
Allow(Target::Trait),
Allow(Target::Static),
Allow(Target::Crate),
]);

fn finalize(mut self, cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {
if self.promotable {
Expand Down
9 changes: 0 additions & 9 deletions compiler/rustc_expand/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,15 +962,6 @@ impl SyntaxExtension {

let stability = find_attr!(attrs, AttributeKind::Stability { stability, .. } => *stability);

// FIXME(jdonszelmann): make it impossible to miss the or_else in the typesystem
if let Some(sp) =
find_attr!(attrs, AttributeKind::RustcConstStability { span, .. } => *span)
{
sess.dcx().emit_err(errors::MacroConstStability {
span: sp,
head_span: sess.source_map().guess_head_span(span),
});
}
if let Some(sp) = find_attr!(attrs, AttributeKind::RustcBodyStability{ span, .. } => *span)
{
sess.dcx().emit_err(errors::MacroBodyStability {
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_expand/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@ pub(crate) struct ResolveRelativePath {
pub path: String,
}

#[derive(Diagnostic)]
#[diag("macros cannot have const stability attributes")]
pub(crate) struct MacroConstStability {
#[primary_span]
#[label("invalid const stability attribute")]
pub span: Span,
#[label("const stability attribute affects this macro")]
pub head_span: Span,
}

#[derive(Diagnostic)]
#[diag("macros cannot have body stability attributes")]
pub(crate) struct MacroBodyStability {
Expand Down
31 changes: 30 additions & 1 deletion compiler/rustc_hir_analysis/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1569,11 +1569,40 @@ pub(super) fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, def_id:

let predicates = predicates.instantiate_identity(tcx);

let assoc_const_obligations: Vec<_> = predicates
.predicates
.iter()
.copied()
.zip(predicates.spans.iter().copied())
.filter_map(|(clause, sp)| {
let proj = clause.as_projection_clause()?;
let pred_binder = proj
.map_bound(|pred| {
pred.term.as_const().map(|ct| {
let assoc_const_ty = tcx
.type_of(pred.projection_term.def_id)
.instantiate(tcx, pred.projection_term.args);
ty::ClauseKind::ConstArgHasType(ct, assoc_const_ty)
})
})
.transpose();
pred_binder.map(|pred_binder| {
let cause = traits::ObligationCause::new(
sp,
wfcx.body_def_id,
ObligationCauseCode::WhereClause(def_id.to_def_id(), sp),
);
Obligation::new(tcx, cause, wfcx.param_env, pred_binder)
})
})
.collect();

assert_eq!(predicates.predicates.len(), predicates.spans.len());
let wf_obligations = predicates.into_iter().flat_map(|(p, sp)| {
traits::wf::clause_obligations(infcx, wfcx.param_env, wfcx.body_def_id, p, sp)
});
let obligations: Vec<_> = wf_obligations.chain(default_obligations).collect();
let obligations: Vec<_> =
wf_obligations.chain(default_obligations).chain(assoc_const_obligations).collect();
wfcx.register_obligations(obligations);
}

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use rustc_parse::lexer::StripTokens;
use rustc_parse::new_parser_from_source_str;
use rustc_parse::parser::Recovery;
use rustc_parse::parser::attr::AllowLeadingUnsafe;
use rustc_query_impl::QueryCtxt;
use rustc_query_system::query::print_query_stack;
use rustc_query_impl::{QueryCtxt, print_query_stack};
use rustc_session::config::{self, Cfg, CheckCfg, ExpectedValues, Input, OutFileName};
use rustc_session::parse::ParseSess;
use rustc_session::{CompilerIO, EarlyDiagCtxt, Session, lint};
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ pub(crate) fn run_in_thread_pool_with_globals<
use rustc_data_structures::defer;
use rustc_data_structures::sync::FromDyn;
use rustc_middle::ty::tls;
use rustc_query_impl::QueryCtxt;
use rustc_query_system::query::{QueryContext, break_query_cycles};
use rustc_query_impl::{QueryCtxt, break_query_cycles};

let thread_stack_size = init_stack_size(thread_builder_diag);

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod keys;
pub mod on_disk_cache;
#[macro_use]
pub mod plumbing;
pub mod values;

pub fn describe_as_module(def_id: impl Into<LocalDefId>, tcx: TyCtxt<'_>) -> String {
let def_id = def_id.into();
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_next_trait_solver/src/solve/trait_goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,9 @@ where
///
/// because these impls overlap, and I'd rather not build a coherence hack for
/// this harmless overlap.
///
/// This trait is indirectly exposed on stable, so do *not* extend the set of types that
/// implement the trait without FCP!
fn consider_builtin_bikeshed_guaranteed_no_drop_candidate(
ecx: &mut EvalCtxt<'_, D>,
goal: Goal<I, Self>,
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_query_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
measureme = "12.0.1"
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_hashes = { path = "../rustc_hashes" }
Expand All @@ -15,6 +16,8 @@ rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" }
rustc_query_system = { path = "../rustc_query_system" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
tracing = "0.1"
# tidy-alphabetical-end
57 changes: 57 additions & 0 deletions compiler/rustc_query_impl/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use rustc_errors::codes::*;
use rustc_hir::limit::Limit;
use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{Span, Symbol};
Expand All @@ -22,3 +23,59 @@ pub(crate) struct QueryOverflowNote {
pub desc: String,
pub depth: usize,
}

#[derive(Subdiagnostic)]
#[note("...which requires {$desc}...")]
pub(crate) struct CycleStack {
#[primary_span]
pub span: Span,
pub desc: String,
}

#[derive(Subdiagnostic)]
pub(crate) enum StackCount {
#[note("...which immediately requires {$stack_bottom} again")]
Single,
#[note("...which again requires {$stack_bottom}, completing the cycle")]
Multiple,
}

#[derive(Subdiagnostic)]
pub(crate) enum Alias {
#[note("type aliases cannot be recursive")]
#[help("consider using a struct, enum, or union instead to break the cycle")]
#[help(
"see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information"
)]
Ty,
#[note("trait aliases cannot be recursive")]
Trait,
}

#[derive(Subdiagnostic)]
#[note("cycle used when {$usage}")]
pub(crate) struct CycleUsage {
#[primary_span]
pub span: Span,
pub usage: String,
}

#[derive(Diagnostic)]
#[diag("cycle detected when {$stack_bottom}", code = E0391)]
pub(crate) struct Cycle {
#[primary_span]
pub span: Span,
pub stack_bottom: String,
#[subdiagnostic]
pub cycle_stack: Vec<CycleStack>,
#[subdiagnostic]
pub stack_count: StackCount,
#[subdiagnostic]
pub alias: Option<Alias>,
#[subdiagnostic]
pub cycle_usage: Option<CycleUsage>,
#[note(
"see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information"
)]
pub note_span: (),
}
8 changes: 4 additions & 4 deletions compiler/rustc_query_impl/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ use rustc_middle::dep_graph::DepsType;
use rustc_middle::ty::TyCtxt;
use rustc_query_system::dep_graph::{DepGraphData, DepNodeKey, HasDepContext};
use rustc_query_system::query::{
ActiveKeyStatus, CycleError, CycleErrorHandling, QueryCache, QueryContext, QueryJob,
QueryJobId, QueryJobInfo, QueryLatch, QueryMap, QueryMode, QueryStackDeferred, QueryStackFrame,
QueryState, incremental_verify_ich, report_cycle,
ActiveKeyStatus, CycleError, CycleErrorHandling, QueryCache, QueryJob, QueryJobId, QueryLatch,
QueryMode, QueryStackDeferred, QueryStackFrame, QueryState, incremental_verify_ich,
};
use rustc_span::{DUMMY_SP, Span};

use crate::dep_graph::{DepContext, DepNode, DepNodeIndex};
use crate::job::{QueryJobInfo, QueryMap, find_cycle_in_stack, report_cycle};
use crate::{QueryCtxt, QueryFlags, SemiDynamicQueryDispatcher};

#[inline]
Expand Down Expand Up @@ -218,7 +218,7 @@ fn cycle_error<'tcx, C: QueryCache, const FLAGS: QueryFlags>(
.ok()
.expect("failed to collect active queries");

let error = try_execute.find_cycle_in_stack(query_map, &qcx.current_query_job(), span);
let error = find_cycle_in_stack(try_execute, query_map, &qcx.current_query_job(), span);
(mk_cycle(query, qcx, error.lift()), None)
}

Expand Down
Loading
Loading