Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
845da88
refactor: remove Ord bound from BinaryHeap::new etc
aatifsyed Nov 28, 2025
fcf2426
fix: BinaryHeap<T: Ord>::peek_mut
aatifsyed Nov 28, 2025
9156b54
Update to_uppercase docs to avoid ß->SS example
guilhermeljs Jan 9, 2026
c10f0dd
Add comment to clarify that 'ffi' is a single Unicode code point mappin…
guilhermeljs Jan 10, 2026
6b5a1a5
Switch from ffi to ſt ligature for better visual clarity
guilhermeljs Jan 12, 2026
c98b90e
std: Change UEFI env vars to volatile storage
nicholasbishop Jan 12, 2026
cafe917
On unmet trait bound, mention if trait is unstable
estebank Jan 12, 2026
89713fc
Mention `Range` when `Step` trait bound is unmet
estebank Jan 12, 2026
45edce2
Update rustc_on_unimplemented message for `Step`
estebank Jan 13, 2026
4708985
Update run-make test output
estebank Jan 13, 2026
9b7f612
Update main label
estebank 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
8afa95d
Avoid should-fail in two ui tests
bjorn3 Jan 13, 2026
15112ee
Avoid should-fail in a codegen-llvm test
bjorn3 Jan 13, 2026
27e09ce
Update ui-fulldeps --stage 2 tests
estebank Jan 13, 2026
814647f
Change some `matches!(.., .. if ..)` with let-chains
estebank Dec 26, 2025
c4820e6
resolve: Refactor away the side table `decl_parent_modules`
petrochenkov Jan 9, 2026
5435e81
also handle ENOTTY ioctl errors when checking pidfd -> pid support
the8472 Jan 13, 2026
1fe705c
Mention the type in the label, to avoid confusion at the cost of redu…
estebank Jan 13, 2026
15d8e9e
Recognize potential `impl<const N: usize>` to `impl<N>` mistake
estebank Jan 13, 2026
3aa3178
Remove `Deref`/`DerefMut` impl for `Providers`.
nnethercote Jan 13, 2026
9142952
Rollup merge of #149408 - aatifsyed/binary-heap-no-ord, r=tgross35,dt…
JonathanBrouwer Jan 14, 2026
4e4bee8
Rollup merge of #150406 - matches-let-chain, r=Kivooeo,oli-obk,BoxyUw…
JonathanBrouwer Jan 14, 2026
95ea4c5
Rollup merge of #150723 - move_pal_error, r=@tgross35
JonathanBrouwer Jan 14, 2026
129f88c
Rollup merge of #150877 - declmod, r=nnethercote
JonathanBrouwer Jan 14, 2026
2847637
Rollup merge of #150902 - docs-150888-to_uppercase, r=Noratrieb,worki…
JonathanBrouwer Jan 14, 2026
4874f18
Rollup merge of #151034 - bishop-fix-nv, r=joboet
JonathanBrouwer Jan 14, 2026
cbcd1c3
Rollup merge of #151036 - issue-151026, r=mati865
JonathanBrouwer Jan 14, 2026
b431a5e
Rollup merge of #151067 - ui_test_no_should_fail, r=lqd
JonathanBrouwer Jan 14, 2026
be22fe2
Rollup merge of #151072 - fix-pidfd-ioctl, r=jhpratt
JonathanBrouwer Jan 14, 2026
18c62b5
Rollup merge of #151077 - issue-84327, r=fmease
JonathanBrouwer Jan 14, 2026
db10879
Rollup merge of #151096 - rm-providers-deref, r=oli-obk
JonathanBrouwer Jan 14, 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: 2 additions & 1 deletion compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ impl CodegenBackend for GccCodegenBackend {
}

fn provide(&self, providers: &mut Providers) {
providers.global_backend_features = |tcx, ()| gcc_util::global_gcc_features(tcx.sess)
providers.queries.global_backend_features =
|tcx, ()| gcc_util::global_gcc_features(tcx.sess)
}

fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box<dyn Any> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl CodegenBackend for LlvmCodegenBackend {
}

fn provide(&self, providers: &mut Providers) {
providers.global_backend_features =
providers.queries.global_backend_features =
|tcx, ()| llvm_util::global_llvm_features(tcx.sess, false)
}

Expand Down
18 changes: 9 additions & 9 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,15 @@ fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: LocalDefId)
}

pub(crate) fn provide(providers: &mut Providers) {
providers.reachable_non_generics = reachable_non_generics_provider;
providers.is_reachable_non_generic = is_reachable_non_generic_provider_local;
providers.exported_non_generic_symbols = exported_non_generic_symbols_provider_local;
providers.exported_generic_symbols = exported_generic_symbols_provider_local;
providers.upstream_monomorphizations = upstream_monomorphizations_provider;
providers.is_unreachable_local_definition = is_unreachable_local_definition_provider;
providers.upstream_drop_glue_for = upstream_drop_glue_for_provider;
providers.upstream_async_drop_glue_for = upstream_async_drop_glue_for_provider;
providers.wasm_import_module_map = wasm_import_module_map;
providers.queries.reachable_non_generics = reachable_non_generics_provider;
providers.queries.is_reachable_non_generic = is_reachable_non_generic_provider_local;
providers.queries.exported_non_generic_symbols = exported_non_generic_symbols_provider_local;
providers.queries.exported_generic_symbols = exported_generic_symbols_provider_local;
providers.queries.upstream_monomorphizations = upstream_monomorphizations_provider;
providers.queries.is_unreachable_local_definition = is_unreachable_local_definition_provider;
providers.queries.upstream_drop_glue_for = upstream_drop_glue_for_provider;
providers.queries.upstream_async_drop_glue_for = upstream_async_drop_glue_for_provider;
providers.queries.wasm_import_module_map = wasm_import_module_map;
providers.extern_queries.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
providers.extern_queries.upstream_monomorphizations_for =
upstream_monomorphizations_for_provider;
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ pub enum CodegenErrors {

pub fn provide(providers: &mut Providers) {
crate::back::symbol_export::provide(providers);
crate::base::provide(providers);
crate::target_features::provide(providers);
crate::codegen_attrs::provide(providers);
crate::base::provide(&mut providers.queries);
crate::target_features::provide(&mut providers.queries);
crate::codegen_attrs::provide(&mut providers.queries);
providers.queries.global_backend_features = |_tcx: TyCtxt<'_>, ()| vec![];
}

Expand Down
13 changes: 7 additions & 6 deletions compiler/rustc_const_eval/src/check_consts/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,13 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {

// const-eval of `panic_display` assumes the argument is `&&str`
if tcx.is_lang_item(callee, LangItem::PanicDisplay) {
match args[0].node.ty(&self.ccx.body.local_decls, tcx).kind() {
ty::Ref(_, ty, _) if matches!(ty.kind(), ty::Ref(_, ty, _) if ty.is_str()) =>
{}
_ => {
self.check_op(ops::PanicNonStr);
}
if let ty::Ref(_, ty, _) =
args[0].node.ty(&self.ccx.body.local_decls, tcx).kind()
&& let ty::Ref(_, ty, _) = ty.kind()
&& ty.is_str()
{
} else {
self.check_op(ops::PanicNonStr);
}
// Allow this call, skip all the checks below.
return;
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_const_eval/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ pub use self::errors::ReportErrorExt;
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

pub fn provide(providers: &mut Providers) {
const_eval::provide(providers);
providers.tag_for_variant = const_eval::tag_for_variant_provider;
providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
providers.eval_static_initializer = const_eval::eval_static_initializer_provider;
const_eval::provide(&mut providers.queries);
providers.queries.tag_for_variant = const_eval::tag_for_variant_provider;
providers.queries.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider;
providers.queries.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider;
providers.queries.eval_static_initializer = const_eval::eval_static_initializer_provider;
providers.hooks.const_caller_location = util::caller_location::const_caller_location_provider;
providers.eval_to_valtree = |tcx, ty::PseudoCanonicalInput { typing_env, value }| {
providers.queries.eval_to_valtree = |tcx, ty::PseudoCanonicalInput { typing_env, value }| {
const_eval::eval_to_valtree(tcx, typing_env, value)
};
providers.hooks.try_destructure_mir_constant_for_user_output =
const_eval::try_destructure_mir_constant_for_user_output;
providers.valtree_to_const_val =
providers.queries.valtree_to_const_val =
|tcx, cv| const_eval::valtree_to_const_value(tcx, ty::TypingEnv::fully_monomorphized(), cv);
providers.check_validity_requirement = |tcx, (init_kind, param_env_and_ty)| {
providers.queries.check_validity_requirement = |tcx, (init_kind, param_env_and_ty)| {
util::check_validity_requirement(tcx, init_kind, param_env_and_ty)
};
providers.hooks.validate_scalar_in_layout =
Expand Down
46 changes: 23 additions & 23 deletions compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,36 +880,36 @@ pub fn write_interface<'tcx>(tcx: TyCtxt<'tcx>) {

pub static DEFAULT_QUERY_PROVIDERS: LazyLock<Providers> = LazyLock::new(|| {
let providers = &mut Providers::default();
providers.analysis = analysis;
providers.hir_crate = rustc_ast_lowering::lower_to_hir;
providers.resolver_for_lowering_raw = resolver_for_lowering_raw;
providers.stripped_cfg_items = |tcx, _| &tcx.resolutions(()).stripped_cfg_items[..];
providers.resolutions = |tcx, ()| tcx.resolver_for_lowering_raw(()).1;
providers.early_lint_checks = early_lint_checks;
providers.env_var_os = env_var_os;
limits::provide(providers);
proc_macro_decls::provide(providers);
providers.queries.analysis = analysis;
providers.queries.hir_crate = rustc_ast_lowering::lower_to_hir;
providers.queries.resolver_for_lowering_raw = resolver_for_lowering_raw;
providers.queries.stripped_cfg_items = |tcx, _| &tcx.resolutions(()).stripped_cfg_items[..];
providers.queries.resolutions = |tcx, ()| tcx.resolver_for_lowering_raw(()).1;
providers.queries.early_lint_checks = early_lint_checks;
providers.queries.env_var_os = env_var_os;
limits::provide(&mut providers.queries);
proc_macro_decls::provide(&mut providers.queries);
rustc_const_eval::provide(providers);
rustc_middle::hir::provide(providers);
rustc_borrowck::provide(providers);
rustc_middle::hir::provide(&mut providers.queries);
rustc_borrowck::provide(&mut providers.queries);
rustc_incremental::provide(providers);
rustc_mir_build::provide(providers);
rustc_mir_transform::provide(providers);
rustc_monomorphize::provide(providers);
rustc_privacy::provide(providers);
rustc_privacy::provide(&mut providers.queries);
rustc_query_impl::provide(providers);
rustc_resolve::provide(providers);
rustc_hir_analysis::provide(providers);
rustc_hir_typeck::provide(providers);
ty::provide(providers);
traits::provide(providers);
solve::provide(providers);
rustc_passes::provide(providers);
rustc_traits::provide(providers);
rustc_ty_utils::provide(providers);
rustc_resolve::provide(&mut providers.queries);
rustc_hir_analysis::provide(&mut providers.queries);
rustc_hir_typeck::provide(&mut providers.queries);
ty::provide(&mut providers.queries);
traits::provide(&mut providers.queries);
solve::provide(&mut providers.queries);
rustc_passes::provide(&mut providers.queries);
rustc_traits::provide(&mut providers.queries);
rustc_ty_utils::provide(&mut providers.queries);
rustc_metadata::provide(providers);
rustc_lint::provide(providers);
rustc_symbol_mangling::provide(providers);
rustc_lint::provide(&mut providers.queries);
rustc_symbol_mangling::provide(&mut providers.queries);
rustc_codegen_ssa::provide(providers);
*providers
});
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/early/diagnostics/check_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn cargo_help_sub(
// `build_script_build`) to try to figure out if we are building a Cargo build script

let unescaped = &inst(EscapeQuotes::No);
if matches!(&sess.opts.crate_name, Some(crate_name) if crate_name == "build_script_build") {
if let Some("build_script_build") = sess.opts.crate_name.as_deref() {
lints::UnexpectedCfgCargoHelp::lint_cfg(unescaped)
} else {
lints::UnexpectedCfgCargoHelp::lint_cfg_and_build_rs(unescaped, &inst(EscapeQuotes::Yes))
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_lint/src/transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ fn check_int_to_ptr_transmute<'tcx>(
return;
};
// bail-out if the argument is literal 0 as we have other lints for those cases
if matches!(arg.kind, hir::ExprKind::Lit(hir::Lit { node: LitKind::Int(v, _), .. }) if v == 0) {
if let hir::ExprKind::Lit(hir::Lit { node: LitKind::Int(v, _), .. }) = arg.kind
&& v == 0
{
return;
}
// bail-out if the inner type is a ZST
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_metadata/src/rmeta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,6 @@ const SYMBOL_OFFSET: u8 = 1;
const SYMBOL_PREDEFINED: u8 = 2;

pub fn provide(providers: &mut Providers) {
encoder::provide(providers);
encoder::provide(&mut providers.queries);
decoder::provide(providers);
}
7 changes: 5 additions & 2 deletions compiler/rustc_middle/src/mir/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1871,13 +1871,16 @@ fn pretty_print_const_value_tcx<'tcx>(
let u8_type = tcx.types.u8;
match (ct, ty.kind()) {
// Byte/string slices, printed as (byte) string literals.
(_, ty::Ref(_, inner_ty, _)) if matches!(inner_ty.kind(), ty::Str) => {
(_, ty::Ref(_, inner_ty, _)) if let ty::Str = inner_ty.kind() => {
if let Some(data) = ct.try_get_slice_bytes_for_diagnostics(tcx) {
fmt.write_str(&format!("{:?}", String::from_utf8_lossy(data)))?;
return Ok(());
}
}
(_, ty::Ref(_, inner_ty, _)) if matches!(inner_ty.kind(), ty::Slice(t) if *t == u8_type) => {
(_, ty::Ref(_, inner_ty, _))
if let ty::Slice(t) = inner_ty.kind()
&& *t == u8_type =>
{
if let Some(data) = ct.try_get_slice_bytes_for_diagnostics(tcx) {
pretty_print_byte_str(fmt, data)?;
return Ok(());
Expand Down
17 changes: 0 additions & 17 deletions compiler/rustc_middle/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,3 @@ pub struct Providers {
pub extern_queries: crate::query::ExternProviders,
pub hooks: crate::hooks::Providers,
}

/// Backwards compatibility hack to keep the diff small. This
/// gives direct access to the `queries` field's fields, which
/// are what almost everything wants access to.
impl std::ops::DerefMut for Providers {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.queries
}
}

impl std::ops::Deref for Providers {
type Target = crate::query::Providers;

fn deref(&self) -> &Self::Target {
&self.queries
}
}
12 changes: 6 additions & 6 deletions compiler/rustc_mir_build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ use rustc_middle::util::Providers;
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

pub fn provide(providers: &mut Providers) {
providers.check_match = thir::pattern::check_match;
providers.lit_to_const = thir::constant::lit_to_const;
providers.closure_saved_names_of_captured_variables =
providers.queries.check_match = thir::pattern::check_match;
providers.queries.lit_to_const = thir::constant::lit_to_const;
providers.queries.closure_saved_names_of_captured_variables =
builder::closure_saved_names_of_captured_variables;
providers.check_unsafety = check_unsafety::check_unsafety;
providers.check_tail_calls = check_tail_calls::check_tail_calls;
providers.thir_body = thir::cx::thir_body;
providers.queries.check_unsafety = check_unsafety::check_unsafety;
providers.queries.check_tail_calls = check_tail_calls::check_tail_calls;
providers.queries.thir_body = thir::cx::thir_body;
providers.hooks.build_mir_inner_impl = builder::build_mir_inner_impl;
}
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

pub fn provide(providers: &mut Providers) {
coverage::query::provide(providers);
ffi_unwind_calls::provide(providers);
shim::provide(providers);
cross_crate_inline::provide(providers);
ffi_unwind_calls::provide(&mut providers.queries);
shim::provide(&mut providers.queries);
cross_crate_inline::provide(&mut providers.queries);
providers.queries = query::Providers {
mir_keys,
mir_built,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_monomorphize/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,5 +1825,5 @@ pub(crate) fn collect_crate_mono_items<'tcx>(

pub(crate) fn provide(providers: &mut Providers) {
providers.hooks.should_codegen_locally = should_codegen_locally;
providers.items_of_instance = items_of_instance;
providers.queries.items_of_instance = items_of_instance;
}
2 changes: 1 addition & 1 deletion compiler/rustc_monomorphize/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ fn custom_coerce_unsize_info<'tcx>(

pub fn provide(providers: &mut Providers) {
partitioning::provide(providers);
mono_checks::provide(providers);
mono_checks::provide(&mut providers.queries);
}
8 changes: 4 additions & 4 deletions compiler/rustc_monomorphize/src/partitioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,20 +1313,20 @@ fn dump_mono_items_stats<'tcx>(
}

pub(crate) fn provide(providers: &mut Providers) {
providers.collect_and_partition_mono_items = collect_and_partition_mono_items;
providers.queries.collect_and_partition_mono_items = collect_and_partition_mono_items;

providers.is_codegened_item =
providers.queries.is_codegened_item =
|tcx, def_id| tcx.collect_and_partition_mono_items(()).all_mono_items.contains(&def_id);

providers.codegen_unit = |tcx, name| {
providers.queries.codegen_unit = |tcx, name| {
tcx.collect_and_partition_mono_items(())
.codegen_units
.iter()
.find(|cgu| cgu.name() == name)
.unwrap_or_else(|| panic!("failed to find cgu with name {name:?}"))
};

providers.size_estimate = |tcx, instance| {
providers.queries.size_estimate = |tcx, instance| {
match instance.def {
// "Normal" functions size estimate: the number of
// statements, plus one for the terminator.
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,9 @@ impl<'a> Parser<'a> {
}

// Check for misspelled keywords if there are no suggestions added to the diagnostic.
if matches!(&err.suggestions, Suggestions::Enabled(list) if list.is_empty()) {
if let Suggestions::Enabled(list) = &err.suggestions
&& list.is_empty()
{
self.check_for_misspelled_kw(&mut err, &expected);
}
Err(err)
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_parse/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,10 +1203,9 @@ impl<'a> Parser<'a> {
let mut token = Token::dummy();
while i < dist {
token = cursor.next().0;
if matches!(
token.kind,
token::OpenInvisible(origin) | token::CloseInvisible(origin) if origin.skip()
) {
if let token::OpenInvisible(origin) | token::CloseInvisible(origin) = token.kind
&& origin.skip()
{
continue;
}
i += 1;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#![feature(map_try_insert)]
// tidy-alphabetical-end

use rustc_middle::util::Providers;
use rustc_middle::query::Providers;

pub mod abi_test;
mod check_attr;
Expand Down
Loading
Loading