Skip to content

Rollup of 10 pull requests #142656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f27ed88
codegen: test frame pointer attr prefers CLI opt
workingjubilee May 16, 2024
a6b62d8
codegen: modernize frame-pointer-cli-control.rs
workingjubilee May 16, 2024
e57b4b1
encode compiler team acceptance of `-Cforce-frame-pointers` change
workingjubilee May 16, 2024
1b23b64
Add `-Z hint-mostly-unused` to tell rustc that most of a crate will g…
joshtriplett Jan 17, 2025
fe04ae7
stabilize gai
BoxyUwU Jun 11, 2025
35c5144
Move rayon-core to rustc_thread_pool files as is
celinval Jun 11, 2025
0b9b1df
Fix format and tidy for code moved from rayon
celinval Jun 11, 2025
4aa62ea
Use `rustc_thread_pool` instead of `rustc-rayon-core`
celinval Jun 11, 2025
f52c6ee
Another round of tidy / warning fixes
celinval Jun 11, 2025
ce457e1
Get rid of `EscapeDebugInner`.
reitermarkus Mar 8, 2025
3cb0cba
Handle win32 separator & prefixes for cygwin paths
Berrysoft Jun 1, 2025
71afc6f
Add test.
cjgillot Jun 16, 2025
c4b67c6
Reason about borrowed classes in CopyProp.
cjgillot Jun 16, 2025
6da3bf8
Apply suggestions from code review
celinval Jun 16, 2025
5a449fb
tests: remove define so dso_local attr does not disrupt test
workingjubilee Jun 17, 2025
2c2bc10
{aarch64,x86_64}-pc-windows-gnullvm: build host tools
mati865 May 6, 2025
7889332
add deferred command in execution context and update run method
Shourya742 Jun 16, 2025
16bc870
add start methods in exec
Shourya742 Jun 16, 2025
2e4f2d2
move from start process to new start and wait for output api's
Shourya742 Jun 16, 2025
b16ba4d
remove start_porcess helper method
Shourya742 Jun 16, 2025
0c60856
remove new method from command execution
Shourya742 Jun 17, 2025
2270572
add created at to command execution
Shourya742 Jun 17, 2025
dca9fe0
explain reasoning behind spawn API
Shourya742 Jun 17, 2025
05e1ae7
move execution context out of deferred command, add as_ref implementa…
Shourya742 Jun 17, 2025
55e2c26
add run_always to recently migrated start_process command
Shourya742 Jun 17, 2025
186f588
change to executed at
Shourya742 Jun 17, 2025
0512280
allow spawn to behave according to failure behavior
Shourya742 Jun 17, 2025
0ac37ff
Add a test for the size of important types.
nnethercote Jun 14, 2025
68ad730
rustdoc_json: Add a test for some `GenericArgs` cases.
nnethercote Jun 15, 2025
62bec90
rustdoc_json: Fix handling of paths with no generic args.
nnethercote Jun 14, 2025
203793e
Fix some comments.
nnethercote Jun 14, 2025
81a2aec
rustdoc_json: represent generic args consistently.
nnethercote Jun 14, 2025
772dbeb
Rollup merge of #135656 - joshtriplett:hint-mostly-unused, r=saethlin
jhpratt Jun 18, 2025
b89fd7c
Rollup merge of #138237 - reitermarkus:remove-escape-debug-inner, r=t…
jhpratt Jun 18, 2025
54c8454
Rollup merge of #140772 - mati865:gnullvm-host, r=marcoieni,Noratrieb
jhpratt Jun 18, 2025
d1b920e
Rollup merge of #140774 - workingjubilee:should-force-frame-pointers-…
jhpratt Jun 18, 2025
e88b97b
Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, r=lcnr…
jhpratt Jun 18, 2025
a388270
Rollup merge of #141864 - Berrysoft:cygwin-path, r=ChrisDenton
jhpratt Jun 18, 2025
e2d062e
Rollup merge of #142384 - celinval:chores-rayon-mv, r=oli-obk
jhpratt Jun 18, 2025
865a6c8
Rollup merge of #142502 - nnethercote:rustdoc-json-GenericArgs, r=aDo…
jhpratt Jun 18, 2025
73ca7da
Rollup merge of #142571 - cjgillot:borrowed-classes, r=oli-obk
jhpratt Jun 18, 2025
d593e72
Rollup merge of #142591 - Shourya742:2025-06-14-add-spawn-execution-a…
jhpratt Jun 18, 2025
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
39 changes: 25 additions & 14 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2983,6 +2983,15 @@ dependencies = [
"getrandom 0.3.3",
]

[[package]]
name = "rand_xorshift"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
dependencies = [
"rand_core 0.9.3",
]

[[package]]
name = "rand_xoshiro"
version = "0.7.0"
Expand Down Expand Up @@ -3182,16 +3191,6 @@ dependencies = [
"tikv-jemalloc-sys",
]

[[package]]
name = "rustc-rayon-core"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f42932dcd3bcbe484b38a3ccf79b7906fac41c02d408b5b1bac26da3416efdb"
dependencies = [
"crossbeam-deque",
"crossbeam-utils",
]

[[package]]
name = "rustc-semver"
version = "1.1.0"
Expand Down Expand Up @@ -3560,14 +3559,14 @@ dependencies = [
"parking_lot",
"portable-atomic",
"rustc-hash 2.1.1",
"rustc-rayon-core",
"rustc-stable-hash",
"rustc_arena",
"rustc_graphviz",
"rustc_hashes",
"rustc_index",
"rustc_macros",
"rustc_serialize",
"rustc_thread_pool",
"smallvec",
"stacker",
"tempfile",
Expand Down Expand Up @@ -3915,7 +3914,6 @@ dependencies = [
name = "rustc_interface"
version = "0.0.0"
dependencies = [
"rustc-rayon-core",
"rustc_abi",
"rustc_ast",
"rustc_ast_lowering",
Expand Down Expand Up @@ -3954,6 +3952,7 @@ dependencies = [
"rustc_span",
"rustc_symbol_mangling",
"rustc_target",
"rustc_thread_pool",
"rustc_trait_selection",
"rustc_traits",
"rustc_ty_utils",
Expand Down Expand Up @@ -4081,7 +4080,6 @@ dependencies = [
"either",
"gsgdt",
"polonius-engine",
"rustc-rayon-core",
"rustc_abi",
"rustc_apfloat",
"rustc_arena",
Expand All @@ -4105,6 +4103,7 @@ dependencies = [
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_thread_pool",
"rustc_type_ir",
"smallvec",
"thin-vec",
Expand Down Expand Up @@ -4351,7 +4350,6 @@ version = "0.0.0"
dependencies = [
"hashbrown",
"parking_lot",
"rustc-rayon-core",
"rustc_abi",
"rustc_ast",
"rustc_attr_data_structures",
Expand All @@ -4366,6 +4364,7 @@ dependencies = [
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_thread_pool",
"smallvec",
"tracing",
]
Expand Down Expand Up @@ -4527,6 +4526,18 @@ dependencies = [
"tracing",
]

[[package]]
name = "rustc_thread_pool"
version = "0.0.0"
dependencies = [
"crossbeam-deque",
"crossbeam-utils",
"libc",
"rand 0.9.1",
"rand_xorshift",
"scoped-tls",
]

[[package]]
name = "rustc_tools_util"
version = "0.4.2"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exclude = [
"obj",
]

[profile.release.package.rustc-rayon-core]
[profile.release.package.rustc_thread_pool]
# The rustc fork of Rayon has deadlock detection code which intermittently
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)
# so we turn overflow checks off for now.
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_ast_lowering/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ ast_lowering_template_modifier = template modifier
ast_lowering_this_not_async = this is not `async`
ast_lowering_underscore_array_length_unstable =
using `_` for array lengths is unstable
ast_lowering_underscore_expr_lhs_assign =
in expressions, `_` can only be used on the left-hand side of an assignment
.label = `_` not allowed here
Expand Down
13 changes: 2 additions & 11 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use rustc_data_structures::sorted_map::SortedMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::spawn;
use rustc_data_structures::tagged_ptr::TaggedRef;
use rustc_errors::{DiagArgFromDisplay, DiagCtxtHandle, StashKey};
use rustc_errors::{DiagArgFromDisplay, DiagCtxtHandle};
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
use rustc_hir::def_id::{CRATE_DEF_ID, LOCAL_CRATE, LocalDefId};
use rustc_hir::lints::DelayedLint;
Expand All @@ -60,7 +60,7 @@ use rustc_index::{Idx, IndexSlice, IndexVec};
use rustc_macros::extension;
use rustc_middle::span_bug;
use rustc_middle::ty::{ResolverAstLowering, TyCtxt};
use rustc_session::parse::{add_feature_diagnostics, feature_err};
use rustc_session::parse::add_feature_diagnostics;
use rustc_span::symbol::{Ident, Symbol, kw, sym};
use rustc_span::{DUMMY_SP, DesugaringKind, Span};
use smallvec::SmallVec;
Expand Down Expand Up @@ -2109,15 +2109,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
// `ExprKind::Paren(ExprKind::Underscore)` and should also be lowered to `GenericArg::Infer`
match c.value.peel_parens().kind {
ExprKind::Underscore => {
if !self.tcx.features().generic_arg_infer() {
feature_err(
&self.tcx.sess,
sym::generic_arg_infer,
c.value.span,
fluent_generated::ast_lowering_underscore_array_length_unstable,
)
.stash(c.value.span, StashKey::UnderscoreForArrayLengths);
}
let ct_kind = hir::ConstArgKind::Infer(self.lower_span(c.value.span), ());
self.arena.alloc(hir::ConstArg { hir_id: self.lower_node_id(c.id), kind: ct_kind })
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ indexmap = "2.4.0"
jobserver_crate = { version = "0.1.28", package = "jobserver" }
measureme = "12.0.1"
rustc-hash = "2.0.0"
rustc-rayon-core = { version = "0.5.0" }
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
rustc_arena = { path = "../rustc_arena" }
rustc_graphviz = { path = "../rustc_graphviz" }
rustc_hashes = { path = "../rustc_hashes" }
rustc_index = { path = "../rustc_index", package = "rustc_index" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
smallvec = { version = "1.8.1", features = ["const_generics", "union", "may_dangle"] }
stacker = "0.1.17"
tempfile = "3.2"
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_data_structures/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
//! | | | `parking_lot::Mutex<T>` |
//! | `RwLock<T>` | `RefCell<T>` | `parking_lot::RwLock<T>` |
//! | `MTLock<T>` [^1] | `T` | `Lock<T>` |
//! | | | |
//! | `ParallelIterator` | `Iterator` | `rayon::iter::ParallelIterator` |
//!
//! [^1]: `MTLock` is similar to `Lock`, but the serial version avoids the cost
//! of a `RefCell`. This is appropriate when interior mutability is not
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_data_structures/src/sync/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ macro_rules! parallel {
pub fn spawn(func: impl FnOnce() + DynSend + 'static) {
if mode::is_dyn_thread_safe() {
let func = FromDyn::from(func);
rayon_core::spawn(|| {
rustc_thread_pool::spawn(|| {
(func.into_inner())();
});
} else {
Expand All @@ -107,11 +107,11 @@ pub fn spawn(func: impl FnOnce() + DynSend + 'static) {
// This function only works when `mode::is_dyn_thread_safe()`.
pub fn scope<'scope, OP, R>(op: OP) -> R
where
OP: FnOnce(&rayon_core::Scope<'scope>) -> R + DynSend,
OP: FnOnce(&rustc_thread_pool::Scope<'scope>) -> R + DynSend,
R: DynSend,
{
let op = FromDyn::from(op);
rayon_core::scope(|s| FromDyn::from(op.into_inner()(s))).into_inner()
rustc_thread_pool::scope(|s| FromDyn::from(op.into_inner()(s))).into_inner()
}

#[inline]
Expand All @@ -124,7 +124,7 @@ where
let oper_a = FromDyn::from(oper_a);
let oper_b = FromDyn::from(oper_b);
let (a, b) = parallel_guard(|guard| {
rayon_core::join(
rustc_thread_pool::join(
move || guard.run(move || FromDyn::from(oper_a.into_inner()())),
move || guard.run(move || FromDyn::from(oper_b.into_inner()())),
)
Expand Down Expand Up @@ -158,7 +158,7 @@ fn par_slice<I: DynSend>(
let (left, right) = items.split_at_mut(items.len() / 2);
let mut left = state.for_each.derive(left);
let mut right = state.for_each.derive(right);
rayon_core::join(move || par_rec(*left, state), move || par_rec(*right, state));
rustc_thread_pool::join(move || par_rec(*left, state), move || par_rec(*right, state));
}
}

Expand Down Expand Up @@ -241,7 +241,7 @@ pub fn par_map<I: DynSend, T: IntoIterator<Item = I>, R: DynSend, C: FromIterato
pub fn broadcast<R: DynSend>(op: impl Fn(usize) -> R + DynSync) -> Vec<R> {
if mode::is_dyn_thread_safe() {
let op = FromDyn::from(op);
let results = rayon_core::broadcast(|context| op.derive(op(context.index())));
let results = rustc_thread_pool::broadcast(|context| op.derive(op(context.index())));
results.into_iter().map(|r| r.into_inner()).collect()
} else {
vec![op(0)]
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ declare_features! (
(accepted, fn_must_use, "1.27.0", Some(43302)),
/// Allows capturing variables in scope using format_args!
(accepted, format_args_capture, "1.58.0", Some(67984)),
/// Infer generic args for both consts and types.
(accepted, generic_arg_infer, "CURRENT_RUSTC_VERSION", Some(85077)),
/// Allows associated types to be generic, e.g., `type Foo<T>;` (RFC 1598).
(accepted, generic_associated_types, "1.65.0", Some(44265)),
/// Allows attributes on lifetime/type formal parameters in generics (RFC 1327).
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,6 @@ declare_features! (
(unstable, frontmatter, "1.88.0", Some(136889)),
/// Allows defining gen blocks and `gen fn`.
(unstable, gen_blocks, "1.75.0", Some(117078)),
/// Infer generic args for both consts and types.
(unstable, generic_arg_infer, "1.55.0", Some(85077)),
/// Allows non-trivial generic constants which have to have wfness manually propagated to callers
(incomplete, generic_const_exprs, "1.56.0", Some(76560)),
/// Allows generic parameters and where-clauses on free & associated const items.
Expand Down
17 changes: 1 addition & 16 deletions compiler/rustc_hir_analysis/src/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,6 @@ fn infer_placeholder_type<'tcx>(
if let Some(ty) = node.ty() {
visitor.visit_ty_unambig(ty);
}
// If we have just one span, let's try to steal a const `_` feature error.
let try_steal_span = if !tcx.features().generic_arg_infer() && visitor.spans.len() == 1
{
visitor.spans.first().copied()
} else {
None
};
// If we didn't find any infer tys, then just fallback to `span`.
if visitor.spans.is_empty() {
visitor.spans.push(span);
Expand Down Expand Up @@ -489,15 +482,7 @@ fn infer_placeholder_type<'tcx>(
}
}

if let Some(try_steal_span) = try_steal_span {
cx.dcx().try_steal_replace_and_emit_err(
try_steal_span,
StashKey::UnderscoreForArrayLengths,
diag,
)
} else {
diag.emit()
}
diag.emit()
});
Ty::new_error(tcx, guar)
}
Expand Down
15 changes: 1 addition & 14 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_middle::ty::{
self, GenericArgsRef, GenericParamDef, GenericParamDefKind, IsSuggestable, Ty,
};
use rustc_session::lint::builtin::LATE_BOUND_LIFETIME_ARGUMENTS;
use rustc_span::{kw, sym};
use rustc_span::kw;
use smallvec::SmallVec;
use tracing::{debug, instrument};

Expand Down Expand Up @@ -258,19 +258,6 @@ pub fn lower_generic_args<'tcx: 'a, 'a>(
GenericParamDefKind::Const { .. },
_,
) => {
if let GenericParamDefKind::Const { .. } = param.kind
&& let GenericArg::Infer(inf) = arg
&& !tcx.features().generic_arg_infer()
{
rustc_session::parse::feature_err(
tcx.sess,
sym::generic_arg_infer,
inf.span,
"const arguments cannot yet be inferred with `_`",
)
.emit();
}

// We lower to an infer even when the feature gate is not enabled
// as it is useful for diagnostics to be able to see a `ConstKind::Infer`
args.push(ctx.provided_kind(&args, param, arg));
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
rustc-rayon-core = { version = "0.5.0" }
rustc_ast = { path = "../rustc_ast" }
rustc_ast_lowering = { path = "../rustc_ast_lowering" }
rustc_ast_passes = { path = "../rustc_ast_passes" }
Expand Down Expand Up @@ -43,6 +42,7 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
rustc_target = { path = "../rustc_target" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_traits = { path = "../rustc_traits" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ fn test_unstable_options_tracking_hash() {
tracked!(force_unstable_if_unmarked, true);
tracked!(function_return, FunctionReturn::ThunkExtern);
tracked!(function_sections, Some(false));
tracked!(hint_mostly_unused, true);
tracked!(human_readable_cgu_names, true);
tracked!(incremental_ignore_spans, true);
tracked!(inline_mir, Some(true));
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub(crate) fn run_in_thread_pool_with_globals<

let proxy_ = Arc::clone(&proxy);
let proxy__ = Arc::clone(&proxy);
let builder = rayon_core::ThreadPoolBuilder::new()
let builder = rustc_thread_pool::ThreadPoolBuilder::new()
.thread_name(|_| "rustc".to_string())
.acquire_thread_handler(move || proxy_.acquire_thread())
.release_thread_handler(move || proxy__.release_thread())
Expand All @@ -218,7 +218,7 @@ pub(crate) fn run_in_thread_pool_with_globals<
// locals to it. The new thread runs the deadlock handler.

let current_gcx2 = current_gcx2.clone();
let registry = rayon_core::Registry::current();
let registry = rustc_thread_pool::Registry::current();
let session_globals = rustc_span::with_session_globals(|session_globals| {
session_globals as *const SessionGlobals as usize
});
Expand Down Expand Up @@ -265,7 +265,7 @@ pub(crate) fn run_in_thread_pool_with_globals<
builder
.build_scoped(
// Initialize each new worker thread when created.
move |thread: rayon_core::ThreadBuilder| {
move |thread: rustc_thread_pool::ThreadBuilder| {
// Register the thread for use with the `WorkerLocal` type.
registry.register();

Expand All @@ -274,7 +274,7 @@ pub(crate) fn run_in_thread_pool_with_globals<
})
},
// Run `f` on the first thread in the thread pool.
move |pool: &rayon_core::ThreadPool| {
move |pool: &rustc_thread_pool::ThreadPool| {
pool.install(|| f(current_gcx.into_inner(), proxy))
},
)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ bitflags = "2.4.1"
either = "1.5.0"
gsgdt = "0.1.2"
polonius-engine = "0.13.0"
rustc-rayon-core = { version = "0.5.0" }
rustc_abi = { path = "../rustc_abi" }
rustc_apfloat = "0.2.0"
rustc_arena = { path = "../rustc_arena" }
Expand All @@ -33,6 +32,7 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
Expand Down
Loading