Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0485003
core: implement FusedIterator for StepBy
Lfan-ke Jul 26, 2026
9a8b45d
tests/ui/union: add annotations for reference rules
DanielEScherzer Feb 18, 2026
e6c3b3d
tests/ui/rust-2018: add annotations for reference rules
DanielEScherzer Aug 12, 2026
d8d3e24
mailmap: fix nia's gazillion emails
nia-e Aug 13, 2026
0594f7c
cargotest: replace Servo with Stylo
HNO3Miracle Aug 5, 2026
c7b9773
Revert "Add regression test for const fn returning Vec of boxed dyn Any"
zakrad Aug 14, 2026
0a01e2f
rustdoc: Simplify `cfg` hierarchy and generate better `cfg` messages
GuillaumeGomez Aug 14, 2026
efd7436
Add regression test for #145075
GuillaumeGomez Aug 14, 2026
725945e
Take bors try-perf branch into account in verify-channel.sh
Kobzol Aug 14, 2026
652ab85
stabilize `extern "custom"`
folkertdev Jun 27, 2026
97fdee6
Even more cfg cleanup
GuillaumeGomez Aug 14, 2026
990c068
rustc.1: `-O` is `-C opt-level=3`
cuviper Aug 14, 2026
d77c4ae
Rollup merge of #161111 - Kobzol:ci-try-perf, r=Mark-Simulacrum
jhpratt Aug 15, 2026
ea037a8
Rollup merge of #158504 - folkertdev:stabilize-extern-custom, r=tgross35
jhpratt Aug 15, 2026
c8685a7
Rollup merge of #159963 - Lfan-ke:feature/step-by-fused-iterator, r=j…
jhpratt Aug 15, 2026
2fad647
Rollup merge of #152826 - DanielEScherzer:test-references-unions, r=t…
jhpratt Aug 15, 2026
22b07bf
Rollup merge of #160556 - HNO3Miracle:cargotest-use-stylo, r=clubby789
jhpratt Aug 15, 2026
97dce21
Rollup merge of #161011 - DanielEScherzer:test-references-rust-2018, …
jhpratt Aug 15, 2026
6b14b20
Rollup merge of #161030 - nia-e:fixup-mailmap, r=Mark-Simulacrum
jhpratt Aug 15, 2026
e49908c
Rollup merge of #161083 - zakrad:revert-84170-test, r=JonathanBrouwer
jhpratt Aug 15, 2026
71a3663
Rollup merge of #161105 - GuillaumeGomez:improve-cfg-message, r=Urgau
jhpratt Aug 15, 2026
1d79916
Rollup merge of #161112 - cuviper:O3, r=saethlin
jhpratt Aug 15, 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
5 changes: 5 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,11 @@ Nathaniel Hamovitz <18648574+nhamovitz@users.noreply.github.com>
Nathaniel Herman <nherman@post.harvard.edu> Nathaniel Herman <nherman@college.harvard.edu>
Neil Pankey <npankey@gmail.com> <neil@wire.im>
Ngo Iok Ui (Wu Yu Wei) <wusyong9104@gmail.com>
Nia Deckers <me@nia.gay>
Nia Deckers <me@nia.gay> <nia-e@haecceity.cc>
Nia Deckers <me@nia.gay> <nia@zed.dev>
Nia Deckers <me@nia.gay> <nia@hexcat.nl>
Nia Deckers <me@nia.gay> <a5b6@riseup.net>
Nicholas Baron <nicholas.baron.ten@gmail.com>
Nicholas Bishop <nbishop@nbishop.net> <nicholasbishop@gmail.com>
Nicholas Bishop <nbishop@nbishop.net> <nicholasbishop@google.com>
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_ast_lowering/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
ExternAbi::Rust
| ExternAbi::C { .. }
| ExternAbi::Cdecl { .. }
| ExternAbi::Custom
| ExternAbi::Stdcall { .. }
| ExternAbi::Fastcall { .. }
| ExternAbi::Thiscall { .. }
Expand Down Expand Up @@ -144,9 +145,6 @@ pub fn extern_abi_stability(abi: ExternAbi) -> Result<(), UnstableAbi> {
feature: sym::cmse_nonsecure_entry,
explain: GateReason::Experimental,
}),
ExternAbi::Custom => {
Err(UnstableAbi { abi, feature: sym::abi_custom, explain: GateReason::Experimental })
}
ExternAbi::Swift => {
Err(UnstableAbi { abi, feature: sym::abi_swift, explain: GateReason::Experimental })
}
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 @@ -46,6 +46,8 @@ declare_features! (

/// Allows `#[target_feature(...)]` on aarch64 platforms
(accepted, aarch64_target_feature, "1.61.0", Some(44839)),
/// Allows `extern "custom" fn()`.
(accepted, abi_custom, "CURRENT_RUSTC_VERSION", Some(140829)),
/// Allows using the `efiapi` ABI.
(accepted, abi_efiapi, "1.68.0", Some(65815)),
/// Allows the sysV64 ABI to be specified on all platforms
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 @@ -372,8 +372,6 @@ declare_features! (
(unstable, abi_avr_interrupt, "1.45.0", Some(69664)),
/// Allows `extern "cmse-nonsecure-call" fn()`.
(unstable, abi_cmse_nonsecure_call, "1.90.0", Some(81391)),
/// Allows `extern "custom" fn()`.
(unstable, abi_custom, "1.89.0", Some(140829)),
/// Allows `extern "gpu-kernel" fn()`.
(unstable, abi_gpu_kernel, "1.86.0", Some(135467)),
/// Allows `extern "msp430-interrupt" fn()`.
Expand Down
1 change: 0 additions & 1 deletion library/compiler-builtins/compiler-builtins/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
#![cfg_attr(all(target_family = "wasm"), feature(wasm_numeric_instr))]
#![feature(abi_custom)]
#![feature(abi_unadjusted)]
#![feature(asm_experimental_arch)]
#![feature(cfg_target_has_atomic)]
Expand Down
7 changes: 6 additions & 1 deletion library/core/src/iter/adapters/step_by.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::intrinsics;
use crate::iter::{TrustedLen, TrustedRandomAccess, from_fn};
use crate::iter::{FusedIterator, TrustedLen, TrustedRandomAccess, from_fn};
use crate::num::NonZero;
use crate::ops::{Range, Try};
use crate::range::RangeIter;
Expand Down Expand Up @@ -136,6 +136,11 @@ where
#[stable(feature = "iterator_step_by", since = "1.28.0")]
impl<I> ExactSizeIterator for StepBy<I> where I: ExactSizeIterator {}

// StepBy stops yielding items once the underlying iterator does, so it is fused
// whenever the underlying iterator is fused.
#[stable(feature = "step_by_fused", since = "CURRENT_RUSTC_VERSION")]
impl<I> FusedIterator for StepBy<I> where I: FusedIterator {}

// SAFETY: This adapter is shortening. TrustedLen requires the upper bound to be calculated correctly.
// These requirements can only be satisfied when the upper bound of the inner iterator's upper
// bound is never `None`. I: TrustedRandomAccess happens to provide this guarantee while
Expand Down
13 changes: 13 additions & 0 deletions library/coretests/tests/iter/adapters/step_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,16 @@ fn test_step_by_nth_non_fused_on_non_first_take() {
// so we should expect `StepBy::nth` to return `None`
assert_eq!(iter.nth(usize::MAX), None)
}

#[test]
fn test_step_by_fused() {
// `StepBy` is fused whenever the underlying iterator is fused.
fn assert_fused<I: FusedIterator>(_: I) {}
assert_fused((0..10).step_by(3));

// Once the underlying fused iterator is exhausted, `StepBy` keeps yielding `None`.
let mut it = (0..3).step_by(5);
assert_eq!(it.next(), Some(0));
assert_eq!(it.next(), None);
assert_eq!(it.next(), None);
}
3 changes: 2 additions & 1 deletion src/ci/scripts/verify-channel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ IFS=$'\n\t'

source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"

if isCiBranch try-perf || isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then
if isCiBranch try-perf || isCiBranch automation/bors/try-perf || \
isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then
echo "channel verification is only executed on PR builds"
exit
fi
Expand Down
2 changes: 1 addition & 1 deletion src/doc/man/rustc.1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Comma separated list of compiler information to print on stdout.
Equivalent to \fI\-C\ debuginfo=2\fR.
.TP
\fB\-O\fR
Equivalent to \fI\-C\ opt\-level=2\fR.
Equivalent to \fI\-C\ opt\-level=3\fR.
.TP
\fB\-o\fR \fIFILENAME\fR
Write output to \fIFILENAME\fR. Ignored if multiple \fI\-\-emit\fR outputs are specified which
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/src/tests/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CI. See the [Crater chapter](crater.md) for more details.
### `cargotest`

`cargotest` is a small tool which runs `cargo test` on a few sample projects
(such as `servo`, `ripgrep`, `tokei`, etc.). This runs as part of CI and ensures
(such as `stylo`, `ripgrep`, `tokei`, etc.). This runs as part of CI and ensures
there aren't any significant regressions:

```console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ The following example can be compiled with `-Zinstrument-mcount=yes` or `-Zinstr

```rust
#![feature(instrument_fn)]
#![feature(abi_custom)]

fn main() {
// Ensure all the early startup occurs before attempting to call this trivial, single-threaded
Expand Down
118 changes: 81 additions & 37 deletions src/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,22 @@ impl Cfg {
}

fn should_append_only_to_description(&self) -> bool {
match self.0 {
CfgEntry::Any(..)
| CfgEntry::All(..)
| CfgEntry::NameValue { .. }
| CfgEntry::Version(..)
| CfgEntry::Not(CfgEntry::NameValue { .. }, _) => true,
CfgEntry::Not(..) | CfgEntry::Bool(..) => false,
fn should_append_only_to_description(cfg: &CfgEntry) -> bool {
match cfg {
CfgEntry::NameValue { .. }
| CfgEntry::Version(..)
| CfgEntry::Not(CfgEntry::NameValue { .. }, _) => true,
CfgEntry::Any(a, _) | CfgEntry::All(a, _) => {
if a.is_empty() {
false
} else {
a.iter().any(|sub| should_append_only_to_description(sub))
}
}
CfgEntry::Not(..) | CfgEntry::Bool(..) => false,
}
}
should_append_only_to_description(&self.0)
}

fn should_use_with_in_description(&self) -> bool {
Expand Down Expand Up @@ -309,7 +317,19 @@ impl Cfg {
}

fn omit_preposition(&self) -> bool {
matches!(self.0, CfgEntry::Bool(..))
fn omit_preposition(cfg: &CfgEntry) -> bool {
match cfg {
CfgEntry::NameValue { .. }
| CfgEntry::Version(..)
| CfgEntry::Not(CfgEntry::NameValue { .. }, _) => false,
CfgEntry::Any(a, _) | CfgEntry::All(a, _) => {
a.is_empty() || matches!(a.as_slice(), [a] if omit_preposition(&a))
}
CfgEntry::Not(a, _) => omit_preposition(a),
CfgEntry::Bool(..) => true,
}
}
omit_preposition(&self.0)
}

pub(crate) fn inner(&self) -> &CfgEntry {
Expand Down Expand Up @@ -459,15 +479,20 @@ impl Display<'_> {
use fmt::Display as _;

let short_longhand = self.1.is_long() && {
let all_crate_features = sub_cfgs.iter().all(|sub_cfg| {
matches!(sub_cfg, CfgEntry::NameValue { name: sym::feature, value: Some(_), .. })
});
let all_target_features = sub_cfgs.iter().all(|sub_cfg| {
matches!(
sub_cfg,
CfgEntry::NameValue { name: sym::target_feature, value: Some(_), .. }
)
});
let all_crate_features = !sub_cfgs.is_empty()
&& sub_cfgs.iter().all(|sub_cfg| {
matches!(
sub_cfg,
CfgEntry::NameValue { name: sym::feature, value: Some(_), .. }
)
});
let all_target_features = !sub_cfgs.is_empty()
&& sub_cfgs.iter().all(|sub_cfg| {
matches!(
sub_cfg,
CfgEntry::NameValue { name: sym::target_feature, value: Some(_), .. }
)
});

if all_crate_features {
fmt.write_str("crate features ")?;
Expand Down Expand Up @@ -506,20 +531,45 @@ impl Display<'_> {

impl fmt::Display for Display<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fn display_bool(fmt: &mut fmt::Formatter<'_>, value: bool) -> fmt::Result {
if value { fmt.write_str("everywhere") } else { fmt.write_str("nowhere") }
}

match &self.0 {
CfgEntry::Not(CfgEntry::Any(sub_cfgs, _), _) => {
let separator = if sub_cfgs.iter().all(is_simple_cfg) { " nor " } else { ", nor " };
fmt.write_str("neither ")?;

sub_cfgs
.iter()
.map(|sub_cfg| {
Wrapped::with_parens()
.when(is_any_cfg(sub_cfg))
.wrap(Display(sub_cfg, self.1))
})
.joined(separator, fmt)
}
CfgEntry::Not(CfgEntry::Not(sub_cfg, _), _) => Display(sub_cfg, self.1).fmt(fmt),
CfgEntry::Not(CfgEntry::Any(sub_cfgs, _), _) => match sub_cfgs.as_slice() {
// `not(any())` is `true` because `any()` is `false`.
[] => display_bool(fmt, true),
[CfgEntry::Bool(value, _)] => display_bool(fmt, !*value),
sub_cfgs => {
let separator =
if sub_cfgs.iter().all(is_simple_cfg) { " nor " } else { ", nor " };
if sub_cfgs.len() > 1 {
fmt.write_str("neither ")?;
} else {
fmt.write_str("not(")?;
}

sub_cfgs
.iter()
.map(|sub_cfg| {
Wrapped::with_parens()
.when(is_any_cfg(sub_cfg))
.wrap(Display(sub_cfg, self.1))
})
.joined(separator, fmt)?;
if sub_cfgs.len() == 1 {
fmt.write_str(")")?;
}
Ok(())
}
},
CfgEntry::Not(s @ CfgEntry::All(sub_cfgs, _), _) => match sub_cfgs.as_slice() {
// `not(all())` is `false` because `all()` is `true`.
[] => display_bool(fmt, false),
[CfgEntry::Bool(value, _)] => display_bool(fmt, !*value),
_ => write!(fmt, "not ({})", Display(s, self.1)),
},
CfgEntry::Not(simple @ CfgEntry::NameValue { .. }, _) => {
write!(fmt, "non-{}", Display(simple, self.1))
}
Expand All @@ -531,13 +581,7 @@ impl fmt::Display for Display<'_> {
}
CfgEntry::All(sub_cfgs, _) => self.display_sub_cfgs(fmt, sub_cfgs.as_slice(), " and "),

CfgEntry::Bool(v, _) => {
if *v {
fmt.write_str("everywhere")
} else {
fmt.write_str("nowhere")
}
}
CfgEntry::Bool(v, _) => display_bool(fmt, *v),

&CfgEntry::NameValue { name, value, .. } => {
let human_readable = match (*name, value) {
Expand Down
38 changes: 36 additions & 2 deletions src/librustdoc/clean/cfg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,19 @@ fn cfg_any_e(v: ThinVec<CfgEntry>) -> CfgEntry {
}

fn cfg_not(v: CfgEntry) -> Cfg {
Cfg(CfgEntry::Not(Box::new(v), DUMMY_SP))
Cfg(cfg_not_e(v))
}

fn cfg_not_e(v: CfgEntry) -> CfgEntry {
CfgEntry::Not(Box::new(v), DUMMY_SP)
}

fn cfg_true() -> Cfg {
Cfg(CfgEntry::Bool(true, DUMMY_SP))
Cfg(cfg_true_e())
}

fn cfg_true_e() -> CfgEntry {
CfgEntry::Bool(true, DUMMY_SP)
}

fn cfg_false() -> Cfg {
Expand Down Expand Up @@ -377,6 +385,32 @@ fn test_render_long_html() {
.render_long_html(),
"Available on <strong>x86-64 and target feature <code>sse2</code></strong> only."
);
// `any(true)`
assert_eq!(
cfg_any(thin_vec![cfg_true_e()]).render_long_html(),
"Available <strong>everywhere</strong>.",
);
// `not(any(true))`
assert_eq!(
cfg_not(cfg_any_e(thin_vec![cfg_true_e()])).render_long_html(),
"Available <strong>nowhere</strong>.",
);
// `any(all(true))`
assert_eq!(
cfg_any(thin_vec![cfg_all_e(thin_vec![cfg_true_e()])]).render_long_html(),
"Available <strong>everywhere</strong>."
);
// `not(any(all(true)))`
assert_eq!(
cfg_not(cfg_any_e(thin_vec![cfg_all_e(thin_vec![cfg_true_e()])])).render_long_html(),
"Available <strong>not(everywhere)</strong>.",
);
// `not(not(any(all(true))))`
assert_eq!(
cfg_not(cfg_not_e(cfg_any_e(thin_vec![cfg_all_e(thin_vec![cfg_true_e()])])))
.render_long_html(),
"Available <strong>everywhere</strong>.",
);
})
}

Expand Down
14 changes: 4 additions & 10 deletions src/tools/cargotest/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ const TEST_REPOS: &[Test] = &[
],
},
Test {
name: "servo",
repo: "https://github.com/servo/servo",
sha: "785a344e32db58d4e631fd3cae17fd1f29a721ab",
name: "stylo",
repo: "https://github.com/servo/stylo",
sha: "127b0b5cab6a6927552e889debb20beb031b79d1",
lock: None,
// Only test Stylo a.k.a. Quantum CSS, the parts of Servo going into Firefox.
// This takes much less time to build than all of Servo and supports stable Rust.
packages: &["selectors"],
packages: &["selectors", "stylo"],
features: None,
manifest_path: None,
filters: &[],
Expand Down Expand Up @@ -213,10 +211,6 @@ fn run_cargo_test(
.env("CFG_DISABLE_CROSS_TESTS", "1")
// Relax #![deny(warnings)] in some crates
.env("RUSTFLAGS", "--cap-lints warn")
// servo tries to use 'lld-link.exe' on windows, but we don't
// have lld on our PATH in CI. Override it to use 'link.exe'
.env("CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER", "link.exe")
.env("CARGO_TARGET_I686_PC_WINDOWS_MSVC_LINKER", "link.exe")
.current_dir(crate_path)
.status()
.unwrap();
Expand Down
20 changes: 20 additions & 0 deletions tests/rustdoc-html/doc-cfg/always-true.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Some generated "cfg text" check.
// Regression test for <https://github.com/rust-lang/rust/issues/145075>.

#![feature(doc_cfg)]
#![crate_name = "foo"]

// This one doesn't display any cfg label.
//@ has 'foo/fn.f.html'
//@ count - '//*[@class="stab portability"]' 0
#[cfg(any(all()))]
pub fn f() {}

//@ has 'foo/fn.f2.html'
// If you change the selector in this one, don't forget to update the one of the `f`
// function as well!
//@ count - '//*[@class="stab portability"]' 1
//@ has - '//*[@class="stab portability"]' 'Available everywhere.'
// This one display a cfg label.
#[cfg(any(true))]
pub fn f2() {}
1 change: 0 additions & 1 deletion tests/ui/abi/bad-custom.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ edition: 2021
//@ check-fail
//@ needs-asm-support
#![feature(abi_custom)]

#[unsafe(naked)]
unsafe extern "custom" fn return_explicit_unit() -> () {
Expand Down
Loading
Loading