Rollup of 13 pull requests#157616
Conversation
…nce Option calling `.cloned()` or `.copied()` on `Option<T>` where `T` is an owned type emitted "`Option<T>` is not an iterator" with a suggestion to prepend `.into_iter()`. the suggested code still did not compile: `Option<T>::into_iter()` yields `T` by value not `&T`, so `.cloned()`/`.copied()` failed again for the same reason. `Option<T>` implements `IntoIterator`, which is why the `impl_into_iterator_should_be_iterator` branch fires. added a guard before it: when the method is `cloned`/`copied`, the receiver is `Option<T>`, and `T` is a concrete non-reference type, emit a targeted label pointing at the correct form (`Option<&T>`) and suggest removing the call instead.
…y 'unused' size_of calls
Inconsistency happens when subdiagnostic pads the main diagnostic with an empty source line (aka "|"). Meanwhile the parallel frontend might bunch subdiagnostics on a single primary diagnostic, removing padding from some other one. Revert "Update reproducibly failing tests when parallel frontend is enabled" This reverts commit f582193. Apply a test directive format suggested by a reviewer Bless thine tests
…d in comptime fn
…rgetted at what it does
Co-authored-by: Taiki Endo <te316e89@gmail.com> Co-authored-by: Kerry Jones <kerry@iodrive.co.za>
BPF does not support C variadics.
Seemingly on XFS only, the `AlreadyExists` variant is returned.
Reproducible on Linux hosts:
```rust
use clap::Parser;
struct Args {
/// Destination to try
#[arg()]
path: std::path::PathBuf,
}
fn main() {
let args = Args::parse();
// Renaming a directory over a non-empty existing directory should fail.
let tmpdir = std::path::Path::new(&args.path);
std::fs::create_dir_all(tmpdir).unwrap();
let source_path = tmpdir.join("source_directory");
let target_path = tmpdir.join("target_directory");
std::fs::create_dir(&source_path).unwrap();
std::fs::create_dir(&target_path).unwrap();
let target_path_file = target_path.join("target_file.txt");
std::fs::write(target_path.join("target_file.txt"), b"target hello world").unwrap();
println!("wrote {target_path_file:?}");
println!("{source_path:?} -> {target_path:?}");
let err = std::fs::rename(source_path, target_path).unwrap_err();
assert_eq!(err.kind(), std::io::ErrorKind::DirectoryNotEmpty);
}
```
```bash
XFS_BLOCK=image-xfs
truncate -s 512M image-xfs
mkfs.xfs -q image-xfs
mkdir mnt-xfs
sudo mount -o loop image-xfs mnt-xfs
sudo chmod 777 mnt-xfs
cargo run -- mnt-xfs/
```
Output:
```
wrote "mnt-xfs/target_directory/target_file.txt"
"mnt-xfs/source_directory" -> "mnt-xfs/target_directory"
thread 'main' (267220) panicked at src/main.rs:30:5:
assertion `left == right` failed
left: AlreadyExists
right: DirectoryNotEmpty
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
asm! support for the Xtensa architecture This implements the asm! support for Xtensa. We've been using this code for a few years in [our fork](https://github.com/esp-rs/rust) and it's been working well. I finally found some time to clean it up a bit and start the upstreaming process. This should be one of the final PRs for Xtensa support on the Rust side (minus bug fixes of course). After this, we're mostly just waiting on the LLVM upstreaming which is going well. This PR doesn't cover all possible asm options for Xtensa, but the base ISA plus a few extras that are used in Espressif chips. r? Amanieu
Add very basic "comptime" fn implementation Implements functions that cannot be called at runtime (and thus also not from normal const functions, as those could be called from runtime). This is done via the internal attribute `rustc_comptime` that can be added to normal functions, turning them into compile-time-only functions. Because @fee1-dead and @compiler-errors did amazing work, we even get trait bounds that work inside comptime fns: via unconditionally-const `const Trait` bounds. Use cases are * rust-lang#146923 * const heap intrinsics * and the other various intrinsics (e.g. size_of 😆) that will just ICE in codegen or panic at runtime if they actually end up in runtime code project goal issue: rust-lang/rust-project-goals#406 no tracking issue until we have a feature gate and some sort of syntax cc @scottmcm as the T-lang goal champion
…cs-in-tests, r=petrochenkov Fix unstable diagnostics in tests The main inconsistency in changed tests happens when subdiagnostic pads the main diagnostic with an empty source line (aka "|"). Meanwhile the parallel frontend might bunch subdiagnostics on a single primary diagnostic, removing padding from some other one. So we can just ignore "|" lines. Updates rust-lang#154314 Reverts rust-lang#157103
Improve TLS codegen by marking the panic/init path as cold This is an extension of the performance improvements seen from <rust-lang#141685>. I noticed that the non-`const` TLS still didn't have the `#[cold]` attribute for the uninit/panic path, and I also realized that neither implementation should have the initialization or panic path inlined, ever. These paths are taken either only once per thread (`init`) or never (`panic`, in a well-behaving Rust program), thus they don't deserve to litter the code generated each time you access a thread-local variable. So in addition to `#[cold]` I added the more aggressive `#[inline(never)]` to both cold paths as well.
…acro_API, r=Mark-Simulacrum Add `_value` API for number literals in proc-macro Part of rust-lang#136652. This PR adds the `*_value` for numbers (integers and floats). However, `f16` and `f128` are voluntarily left out as they're still unstable. Adding support for them is just a matter of uncommenting two lines, so should be fine. Setting same reviewer as last time. r? @Urgau
This comment has been minimized.
This comment has been minimized.
Rollup of 13 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing f3ef3bd (parent) -> cb46fbb (this PR) Test differencesShow 192 test diffsStage 1
Stage 2
Additionally, 162 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard cb46fbb8c6ea799c6fba9188ed889275c35a8c28 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
📌 Perf builds for each rolled up PR:
previous master: f3ef3bd882 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (cb46fbb): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.4%, secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.2%, secondary 1.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 517.572s -> 517.707s (0.03%) |
Successful merges:
_valueAPI for number literals in proc-macro #154608 (Add_valueAPI for number literals in proc-macro)test_rename_directory_to_non_empty_directory#156762 (xfs support intest_rename_directory_to_non_empty_directory)r? @ghost
Create a similar rollup