Skip to content

Rollup of 11 pull requests #144104

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 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
92144e1
Remove `josh-sync` tooling and update README
Kobzol Jul 4, 2025
13dca5e
Update CI workflow to use rustc-josh-sync
Kobzol Jul 4, 2025
9d83749
Document `rustc-josh-sync`
Kobzol Jul 4, 2025
dbad976
Merge pull request #2491 from Kobzol/switch-to-rustc-josh-sync
jieyouxu Jul 4, 2025
f167f9b
external-repos.md: small fixes
tshepang Jul 4, 2025
33c70d9
Merge pull request #2492 from rust-lang/tshepang-patch-1
tshepang Jul 4, 2025
922ee88
Mention that stdarch is managed by josh-sync
Kobzol Jul 8, 2025
342d78d
Merge pull request #2495 from Kobzol/josh-sync-stdarch
jieyouxu Jul 8, 2025
6b8bc68
use a consistent (and recommended) invocation
tshepang Jul 9, 2025
120a361
Merge pull request #2496 from rust-lang/tshepang-a-convenience
tshepang Jul 9, 2025
7b394d2
tweak some git clone commands
tshepang Jul 9, 2025
42472f2
add missing word
tshepang Jul 9, 2025
d99af0b
distcheck had only one possible invocation
tshepang Jul 9, 2025
99fc05b
do not invent a name
tshepang Jul 9, 2025
1a6e543
Merge pull request #2498 from rust-lang/tshepang-patch-1
Noratrieb Jul 10, 2025
7c76abc
Merge pull request #2500 from rust-lang/tshepang-patch-3
Noratrieb Jul 10, 2025
1ef0072
Merge pull request #2499 from rust-lang/tshepang-patch-2
Noratrieb Jul 10, 2025
f1ae43f
Mention that compiler-builtins is now using `rustc-josh-sync`
Kobzol Jul 10, 2025
c6bedc1
Migrate rustc-pull to CI workflow from `josh-sync`
Kobzol Jul 10, 2025
c7cdd14
Merge pull request #2501 from Kobzol/compiler-builtins-josh
jieyouxu Jul 10, 2025
c46e385
Merge pull request #2502 from Kobzol/rustc-josh-sync-ci
jieyouxu Jul 11, 2025
7803c25
directives.md: build-aux-docs does not work with aux-crate
lolbinarycat Jul 11, 2025
39f269c
Merge pull request #2497 from rust-lang/tshepang-git-clone
ZuseZ4 Jul 14, 2025
8ec7e6f
Merge pull request #2504 from lolbinarycat/lolbinarycat-patch-2
jieyouxu Jul 15, 2025
0e423f4
Boostrap: add warning on `optimize = false`
xdoardo Jul 16, 2025
9ef3be2
go over invariants again :3
lcnr Jul 16, 2025
6237eaf
Merge pull request #2506 from lcnr/type-system-invariants
lcnr Jul 16, 2025
fad8dec
fix: false positive double_negations when it jumps macro boundary
anatawa12 Jul 16, 2025
8df6a1d
some improvements to "Invariants of the type system"
tshepang Jul 17, 2025
c113a60
Merge pull request #2507 from rust-lang/tshepang-misc
tshepang Jul 17, 2025
2faf5ed
Prepare for merging from rust-lang/rust
invalid-email-address Jul 17, 2025
ce0de76
Merge ref 'fd2eb391d032' from rust-lang/rust
invalid-email-address Jul 17, 2025
b2474c8
Merge pull request #2508 from rust-lang/rustc-pull
tshepang Jul 17, 2025
dd364bd
copy-paste convenience
tshepang Jul 17, 2025
41c0c5b
Merge pull request #2510 from rust-lang/tshepang-patch-1
tshepang Jul 17, 2025
b7d2782
Remove install Rust script from CI
Kobzol Jul 17, 2025
853333d
constify `Option` methods
oli-obk Jul 15, 2025
2ca2d93
Auto-label `src/ci` and `.github/workflows` with `A-CI`
jieyouxu Jul 17, 2025
491b873
Add myself to `infra-ci` reviewer group
jieyouxu Jul 17, 2025
f204801
fix: fix issue 143740, Wrong messages from compiler confusing methods…
lichuang Jul 16, 2025
a886852
ci: use windows 22 for all free runners
marcoieni Jul 17, 2025
0a71873
panic_main.rs panic=unwind tests needs unwinding
erickt Jul 17, 2025
10762d5
Fix debuginfo-lto-alloc.rs test
bjorn3 Jul 17, 2025
bf24c0d
miri sleep tests: increase slack
RalfJung Jul 17, 2025
dcf6779
Rollup merge of #143967 - oli-obk:const-option-methods, r=fee1-dead
matthiaskrgr Jul 18, 2025
eb370e9
Rollup merge of #144008 - anatawa12:fix-double-negations, r=compiler-…
matthiaskrgr Jul 18, 2025
7088538
Rollup merge of #144010 - xdoardo:bootstrap-warning-optimize-false, r…
matthiaskrgr Jul 18, 2025
a15f0d7
Rollup merge of #144029 - lichuang:fix_issue_143740, r=compiler-errors
matthiaskrgr Jul 18, 2025
b8c38e2
Rollup merge of #144049 - tshepang:rust-push, r=jieyouxu
matthiaskrgr Jul 18, 2025
ab59326
Rollup merge of #144053 - Kobzol:ci-remove-install-rust, r=jieyouxu
matthiaskrgr Jul 18, 2025
69fd0f0
Rollup merge of #144063 - jieyouxu:label-ci, r=Kobzol
matthiaskrgr Jul 18, 2025
bf2a7ec
Rollup merge of #144069 - marcoieni:windows-22-free, r=jieyouxu
matthiaskrgr Jul 18, 2025
ffab549
Rollup merge of #144073 - erickt:ignore-test-on-fuchsia, r=lqd
matthiaskrgr Jul 18, 2025
8646a4f
Rollup merge of #144078 - bjorn3:fix_test, r=compiler-errors
matthiaskrgr Jul 18, 2025
2523a32
Rollup merge of #144083 - RalfJung:miri-sleep, r=oli-obk
matthiaskrgr Jul 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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ jobs:
- name: show the current environment
run: src/ci/scripts/dump-environment.sh

- name: install rust
run: src/ci/scripts/install-rust.sh

- name: install awscli
run: src/ci/scripts/install-awscli.sh

Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
}
}

let sources = candidates.iter().map(|p| self.candidate_source(p, self_ty)).collect();
let sources =
applicable_candidates.iter().map(|p| self.candidate_source(p.0, self_ty)).collect();
return Some(Err(MethodError::Ambiguity(sources)));
}

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,8 @@ impl EarlyLintPass for DoubleNegations {
if let ExprKind::Unary(UnOp::Neg, ref inner) = expr.kind
&& let ExprKind::Unary(UnOp::Neg, ref inner2) = inner.kind
&& !matches!(inner2.kind, ExprKind::Unary(UnOp::Neg, _))
// Don't lint if this jumps macro expansion boundary (Issue #143980)
&& expr.span.eq_ctxt(inner.span)
{
cx.emit_span_lint(
DOUBLE_NEGATIONS,
Expand Down
137 changes: 97 additions & 40 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@
#![stable(feature = "rust1", since = "1.0.0")]

use crate::iter::{self, FusedIterator, TrustedLen};
use crate::marker::Destruct;
use crate::ops::{self, ControlFlow, Deref, DerefMut};
use crate::panicking::{panic, panic_display};
use crate::pin::Pin;
Expand Down Expand Up @@ -649,7 +650,8 @@ impl<T> Option<T> {
#[must_use]
#[inline]
#[stable(feature = "is_some_and", since = "1.70.0")]
pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn is_some_and(self, f: impl ~const FnOnce(T) -> bool + ~const Destruct) -> bool {
match self {
None => false,
Some(x) => f(x),
Expand Down Expand Up @@ -697,7 +699,8 @@ impl<T> Option<T> {
#[must_use]
#[inline]
#[stable(feature = "is_none_or", since = "1.82.0")]
pub fn is_none_or(self, f: impl FnOnce(T) -> bool) -> bool {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn is_none_or(self, f: impl ~const FnOnce(T) -> bool + ~const Destruct) -> bool {
match self {
None => true,
Some(x) => f(x),
Expand Down Expand Up @@ -1023,7 +1026,12 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap_or(self, default: T) -> T {
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn unwrap_or(self, default: T) -> T
where
T: ~const Destruct,
{
match self {
Some(x) => x,
None => default,
Expand All @@ -1042,9 +1050,10 @@ impl<T> Option<T> {
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap_or_else<F>(self, f: F) -> T
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn unwrap_or_else<F>(self, f: F) -> T
where
F: FnOnce() -> T,
F: ~const FnOnce() -> T + ~const Destruct,
{
match self {
Some(x) => x,
Expand Down Expand Up @@ -1073,9 +1082,10 @@ impl<T> Option<T> {
/// [`FromStr`]: crate::str::FromStr
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap_or_default(self) -> T
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn unwrap_or_default(self) -> T
where
T: Default,
T: ~const Default,
{
match self {
Some(x) => x,
Expand Down Expand Up @@ -1139,9 +1149,10 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn map<U, F>(self, f: F) -> Option<U>
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn map<U, F>(self, f: F) -> Option<U>
where
F: FnOnce(T) -> U,
F: ~const FnOnce(T) -> U + ~const Destruct,
{
match self {
Some(x) => Some(f(x)),
Expand Down Expand Up @@ -1169,7 +1180,11 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "result_option_inspect", since = "1.76.0")]
pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn inspect<F>(self, f: F) -> Self
where
F: ~const FnOnce(&T) + ~const Destruct,
{
if let Some(ref x) = self {
f(x);
}
Expand Down Expand Up @@ -1198,9 +1213,11 @@ impl<T> Option<T> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "if you don't need the returned value, use `if let` instead"]
pub fn map_or<U, F>(self, default: U, f: F) -> U
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn map_or<U, F>(self, default: U, f: F) -> U
where
F: FnOnce(T) -> U,
F: ~const FnOnce(T) -> U + ~const Destruct,
U: ~const Destruct,
{
match self {
Some(t) => f(t),
Expand Down Expand Up @@ -1243,10 +1260,11 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn map_or_else<U, D, F>(self, default: D, f: F) -> U
where
D: FnOnce() -> U,
F: FnOnce(T) -> U,
D: ~const FnOnce() -> U + ~const Destruct,
F: ~const FnOnce(T) -> U + ~const Destruct,
{
match self {
Some(t) => f(t),
Expand All @@ -1273,10 +1291,11 @@ impl<T> Option<T> {
/// [default value]: Default::default
#[inline]
#[unstable(feature = "result_option_map_or_default", issue = "138099")]
pub fn map_or_default<U, F>(self, f: F) -> U
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn map_or_default<U, F>(self, f: F) -> U
where
U: Default,
F: FnOnce(T) -> U,
U: ~const Default,
F: ~const FnOnce(T) -> U + ~const Destruct,
{
match self {
Some(t) => f(t),
Expand Down Expand Up @@ -1307,7 +1326,8 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn ok_or<E>(self, err: E) -> Result<T, E> {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn ok_or<E: ~const Destruct>(self, err: E) -> Result<T, E> {
match self {
Some(v) => Ok(v),
None => Err(err),
Expand All @@ -1332,9 +1352,10 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn ok_or_else<E, F>(self, err: F) -> Result<T, E>
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn ok_or_else<E, F>(self, err: F) -> Result<T, E>
where
F: FnOnce() -> E,
F: ~const FnOnce() -> E + ~const Destruct,
{
match self {
Some(v) => Ok(v),
Expand Down Expand Up @@ -1463,7 +1484,12 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn and<U>(self, optb: Option<U>) -> Option<U> {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn and<U>(self, optb: Option<U>) -> Option<U>
where
T: ~const Destruct,
U: ~const Destruct,
{
match self {
Some(_) => optb,
None => None,
Expand Down Expand Up @@ -1502,9 +1528,10 @@ impl<T> Option<T> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_confusables("flat_map", "flatmap")]
pub fn and_then<U, F>(self, f: F) -> Option<U>
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn and_then<U, F>(self, f: F) -> Option<U>
where
F: FnOnce(T) -> Option<U>,
F: ~const FnOnce(T) -> Option<U> + ~const Destruct,
{
match self {
Some(x) => f(x),
Expand Down Expand Up @@ -1538,9 +1565,11 @@ impl<T> Option<T> {
/// [`Some(t)`]: Some
#[inline]
#[stable(feature = "option_filter", since = "1.27.0")]
pub fn filter<P>(self, predicate: P) -> Self
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn filter<P>(self, predicate: P) -> Self
where
P: FnOnce(&T) -> bool,
P: ~const FnOnce(&T) -> bool + ~const Destruct,
T: ~const Destruct,
{
if let Some(x) = self {
if predicate(&x) {
Expand Down Expand Up @@ -1579,7 +1608,11 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn or(self, optb: Option<T>) -> Option<T> {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn or(self, optb: Option<T>) -> Option<T>
where
T: ~const Destruct,
{
match self {
x @ Some(_) => x,
None => optb,
Expand All @@ -1601,9 +1634,13 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn or_else<F>(self, f: F) -> Option<T>
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn or_else<F>(self, f: F) -> Option<T>
where
F: FnOnce() -> Option<T>,
F: ~const FnOnce() -> Option<T> + ~const Destruct,
//FIXME(const_hack): this `T: ~const Destruct` is unnecessary, but even precise live drops can't tell
// no value of type `T` gets dropped here
T: ~const Destruct,
{
match self {
x @ Some(_) => x,
Expand Down Expand Up @@ -1634,7 +1671,11 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "option_xor", since = "1.37.0")]
pub fn xor(self, optb: Option<T>) -> Option<T> {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn xor(self, optb: Option<T>) -> Option<T>
where
T: ~const Destruct,
{
match (self, optb) {
(a @ Some(_), None) => a,
(None, b @ Some(_)) => b,
Expand Down Expand Up @@ -1668,7 +1709,11 @@ impl<T> Option<T> {
#[must_use = "if you intended to set a value, consider assignment instead"]
#[inline]
#[stable(feature = "option_insert", since = "1.53.0")]
pub fn insert(&mut self, value: T) -> &mut T {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn insert(&mut self, value: T) -> &mut T
where
T: ~const Destruct,
{
*self = Some(value);

// SAFETY: the code above just filled the option
Expand Down Expand Up @@ -1720,9 +1765,10 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "option_get_or_insert_default", since = "1.83.0")]
pub fn get_or_insert_default(&mut self) -> &mut T
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn get_or_insert_default(&mut self) -> &mut T
where
T: Default,
T: ~const Default + ~const Destruct,
{
self.get_or_insert_with(T::default)
}
Expand All @@ -1746,9 +1792,11 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "option_entry", since = "1.20.0")]
pub fn get_or_insert_with<F>(&mut self, f: F) -> &mut T
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn get_or_insert_with<F>(&mut self, f: F) -> &mut T
where
F: FnOnce() -> T,
F: ~const FnOnce() -> T + ~const Destruct,
T: ~const Destruct,
{
if let None = self {
*self = Some(f());
Expand Down Expand Up @@ -1812,9 +1860,10 @@ impl<T> Option<T> {
/// ```
#[inline]
#[stable(feature = "option_take_if", since = "1.80.0")]
pub fn take_if<P>(&mut self, predicate: P) -> Option<T>
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn take_if<P>(&mut self, predicate: P) -> Option<T>
where
P: FnOnce(&mut T) -> bool,
P: ~const FnOnce(&mut T) -> bool + ~const Destruct,
{
if self.as_mut().map_or(false, predicate) { self.take() } else { None }
}
Expand Down Expand Up @@ -1859,7 +1908,12 @@ impl<T> Option<T> {
/// assert_eq!(x.zip(z), None);
/// ```
#[stable(feature = "option_zip_option", since = "1.46.0")]
pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)> {
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn zip<U>(self, other: Option<U>) -> Option<(T, U)>
where
T: ~const Destruct,
U: ~const Destruct,
{
match (self, other) {
(Some(a), Some(b)) => Some((a, b)),
_ => None,
Expand Down Expand Up @@ -1895,9 +1949,12 @@ impl<T> Option<T> {
/// assert_eq!(x.zip_with(None, Point::new), None);
/// ```
#[unstable(feature = "option_zip", issue = "70086")]
pub fn zip_with<U, F, R>(self, other: Option<U>, f: F) -> Option<R>
#[rustc_const_unstable(feature = "const_option_ops", issue = "143956")]
pub const fn zip_with<U, F, R>(self, other: Option<U>, f: F) -> Option<R>
where
F: FnOnce(T, U) -> R,
F: ~const FnOnce(T, U) -> R + ~const Destruct,
T: ~const Destruct,
U: ~const Destruct,
{
match (self, other) {
(Some(a), Some(b)) => Some(f(a, b)),
Expand Down
8 changes: 8 additions & 0 deletions src/bootstrap/src/core/config/toml/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,14 @@ impl Config {
lld_enabled = lld_enabled_toml;
std_features = std_features_toml;

if optimize_toml.as_ref().is_some_and(|v| matches!(v, RustOptimize::Bool(false))) {
eprintln!(
"WARNING: setting `optimize` to `false` is known to cause errors and \
should be considered unsupported. Refer to `bootstrap.example.toml` \
for more details."
);
}

optimize = optimize_toml;
self.rust_new_symbol_mangling = new_symbol_mangling;
set(&mut self.rust_optimize_tests, optimize_tests);
Expand Down
6 changes: 4 additions & 2 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ runners:
os: windows-2022
<<: *base-job

# NOTE: windows-2025 has less disk space available than windows-2022,
# because the D drive is missing.
- &job-windows-25
os: windows-2025
<<: *base-job
Expand Down Expand Up @@ -542,13 +544,13 @@ auto:
env:
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-sanitizers --enable-profiler
SCRIPT: make ci-msvc-py
<<: *job-windows-25
<<: *job-windows

- name: x86_64-msvc-2
env:
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-sanitizers --enable-profiler
SCRIPT: make ci-msvc-ps1
<<: *job-windows-25
<<: *job-windows

# i686-msvc is split into two jobs to run tests in parallel.
- name: i686-msvc-1
Expand Down
Loading
Loading