| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Slim `rustc_parse_format` dependencies down
`rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead. This allows the crate to built without having to wait for `syn` (pulled in by `rustc_index_macros`)
Alternatively we could inline the macro, though from the looks of it that will run into trouble with `rustc_randomized_layouts`
|
|
`rustc_index` is only used for its size assertion macro, so demote it to a dev-dependency gated under testing instead
|
|
Provide optional `Read`/`Write` methods for stdio
Override more of the default methods for `io::Read` and `io::Write` for stdio types, when efficient to do so, and deduplicate unsupported types.
Tracked in https://github.com/rust-lang/rust/issues/136756.
try-job: x86_64-msvc-1
|
|
core: optimize `RepeatN`
...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
|
|
Rollup of 8 pull requests
Successful merges:
- #138018 (rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.)
- #138294 (Mark some std tests as requiring `panic = "unwind"`)
- #138468 (rustdoc js: add nonnull helper and typecheck src-script.js)
- #138675 (Add release notes for 1.85.1)
- #138765 (Fix Thread::set_name on cygwin)
- #138786 (Move some driver code around)
- #138793 (target spec check: better error when llvm-floatabi is missing)
- #138822 (De-Stabilize `file_lock`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Rollup of 7 pull requests
Successful merges:
- #138609 (Add stack overflow handler for cygwin)
- #138639 (Clean UI tests 2 of n)
- #138773 (catch_unwind intrinsic: document return value)
- #138782 (test(ui): add tuple-struct-where-clause-suggestion ui test for #91520)
- #138794 (expand: Do not report `cfg_attr` traces on macros as unused attributes)
- #138801 (triagebot: add autolabel rules for D-* and L-*)
- #138804 (Allow inlining for `Atomic*::from_ptr`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
De-Stabilize `file_lock`
This reverts #136794
FCP on the tracking issue (#130994) passsed successfully https://github.com/rust-lang/rust/issues/130994#issuecomment-2646158607 but there are now concerns about the suitability of the proposed API (https://github.com/rust-lang/rust/issues/130994#issuecomment-2734608366)
On zullip it was [suggested](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/File.3A.3Atry_lock.20API.3A.20Result.3Cbool.3E/near/506823067) that it would be better to temporarily(?) destabilize the feature ASAP to buy us some more time reflecting on the API.
This PR implements the revert.
The feature is not currently on beta (https://github.com/rust-lang/rust/blob/beta/library/std/src/fs.rs#L672) so a beta backport is not yet neccessary.
If this revert is accepted, the tracking issue (#130994) should be reopened
|
|
target spec check: better error when llvm-floatabi is missing
|
|
Move some driver code around
`--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run before codegen and thus work even if codegen fails. This can help with debugging.
|
|
Fix Thread::set_name on cygwin
Just like Linux, Cygwin also sets a limitation to thread name.
https://github.com/cygwin/cygwin/blob/8e50c7af7c49819245739d6f626f6fecc394ef7f/winsup/cygwin/thread.cc#L3175
|
|
Add release notes for 1.85.1
Closes #138819.
|
|
r=notriddle
rustdoc js: add nonnull helper and typecheck src-script.js
this removes ``@ts-nocheck`` from `src-script.js` and adds a `nonnull` helper function that assists in adding null checks to places where null values should be impossible.
r? `@notriddle`
|
|
Mark some std tests as requiring `panic = "unwind"`
This allows these test modules to pass on builds/targets without unwinding support, where `panic = "abort"` - the ignored tests are for functionality that's not supported on those targets.
|
|
rustdoc: Use own logic to print `#[repr(..)]` attributes in JSON output.
Switch away from `Debug`-like representation of `#[repr(..)]` attributes, and start using rustdoc's own logic for pretty-printing `#[repr(..)]` in rustdoc JSON.
Part of addressing #137645 but not a complete solution for it.
r? `@aDotInTheVoid`
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #138410 (Couple mir building cleanups)
- #138490 (Forward `stream_position` in `Arc<File>` as well)
- #138535 (Cleanup `LangString::parse`)
- #138536 (stable_mir: Add `MutMirVisitor`)
- #138673 (Fix build failure on Trusty)
- #138750 (Make `crate_hash` not iterate over `hir_crate` owners anymore)
- #138763 (jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
...by adding an optimized implementation of `try_fold` and `fold` as well as replacing some unnecessary `mem::replace` calls with `MaybeUninit` helper methods.
|
|
Allow inlining for `Atomic*::from_ptr`
Currently this cannot be inlined, which among other things means it can't be used in `compiler-builtins` [1]. These are trivial functions that should be inlineable, so add `#[inline]`.
[1]: https://github.com/rust-lang/compiler-builtins/pull/790#issuecomment-2744371738
|
|
triagebot: add autolabel rules for D-* and L-*
fixes #138565
r? `@Noratrieb`
|
|
expand: Do not report `cfg_attr` traces on macros as unused attributes
Fixes https://github.com/rust-lang/rust/issues/138779
|
|
test(ui): add tuple-struct-where-clause-suggestion ui test for #91520
Fixes #91520
I tried to also make it a .fixed test, but I failed to accomplish that.
That's because of the 'consider annotating `Inner<T>` with `#[derive(Clone)]`' suggestion does not compile (conflicting Clone implementations), and I can't isolate them with `rustfix-only-machine-applicable` as both suggestions are not marked as `MachineApplicable`.
Instead I just test that the where clause suggestion is applied to the correct line.
|
|
catch_unwind intrinsic: document return value
Seems like we forgot to document this. The comment reflects what Miri does, which seems to also match what codegen does at least [in `codegen_gnu_try`](https://github.com/rust-lang/rust/blob/b754ef727ca87050a8d758fc44f524cfb4310eff/compiler/rustc_codegen_llvm/src/intrinsic.rs#L953-L964).
|
|
Clean UI tests 2 of n
Modified 4 tests in tests/ui. Cleaned 3 and deleted one.
I have a final commit changing the values in `src/tools/tidy/src/ui_tests.rs`.
I wasn't sure if it was best practice to change this value as you go along or
once at the end. I can rebase to something that incrementally changes the value
in the "cleaned" commits if that is preferred.
Related Issues:
#73494
#133895
r? jieyouxu
|
|
Add stack overflow handler for cygwin
The cygwin runtime handles stack overflow exception and converts it to `SIGSEGV`, but the passed `si_addr` is obtained from `ExceptionInformation[1]` which is actually an undocumented value when stack overflows. Thus I choose to use Windows API directly to register handler, just like how std does on native Windows. The code is basically copied from the Windows one.
Ref:
* https://github.com/cygwin/cygwin/blob/5ec497dc80bcb7ad78cc07bb919b2624b361f017/winsup/cygwin/exceptions.cc#L822-L823
* https://learn.microsoft.com/zh-cn/windows/win32/api/winnt/ns-winnt-exception_record
|
|
jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`
The current jsonpath implementation we use isn't spec-compliant, and is buggy. See https://github.com/freestrings/jsonpath/issues/91
To solve it, it's replaced with https://github.com/besok/jsonpath-rust. This is spec-compiant, and doesn't have a really awkward bug we need to always dance around.
Unfortunately, this requires rewriting almost every test, as the behaviour of `[?(```@`,``` which is *extremely* common was changed. (But the new behaviour makes way more sense, and isn't buggy with tripply nested selectors)
Unblocks #110406. Makes #100515 much easier as we don't need to explain the broken JSONPath implementation
Best reviewed commit-by-commit. The first does the replacement. The next two rewrite the test-suite mechanically. The last rewrites the test-suite by hand.
r? ```@GuillaumeGomez```
|
|
Make `crate_hash` not iterate over `hir_crate` owners anymore
cc https://github.com/rust-lang/rust/issues/95004
One more direct usage of hir::Crate removed
|
|
Fix build failure on Trusty
This target is currently broken due to update to 2024 editon.
```console
$ cargo new --lib repro
$ cd repro
$ cargo check -Z build-std=std --target aarch64-unknown-trusty
Compiling std v0.0.0 ($HOME/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
error: extern blocks must be unsafe
--> $HOME/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/random/trusty.rs:1:1
|
1 | / extern "C" {
2 | | fn trusty_rng_secure_rand(randomBuffer: *mut core::ffi::c_void, randomBufferLen: libc::size_t);
3 | | }
| |_^
error: could not compile `std` (lib) due to 1 previous error
```
cc ```@randomPoison``` ```@ahomescu``` ([target maintainers](https://doc.rust-lang.org/nightly/rustc/platform-support/trusty.html#target-maintainers))
|
|
stable_mir: Add `MutMirVisitor`
Resolves: [rust-lang/project-stable-mir#81](https://github.com/rust-lang/project-stable-mir/issues/81).
I am unsure if we should add a `MutableBody` like Kani did.
Currently, I use `&mut Body` in `MutMirVisitor::visit_body()`.
r? ``````@celinval``````
|
|
r=notriddle
Cleanup `LangString::parse`
Flatten some `if`s into match patterns
Use `str::strip_prefix` instead of `starts_with`+indexing
Avoid redundant tests for `extra.is_some()`
|
|
Forward `stream_position` in `Arc<File>` as well
It was missed in #137165.
|
|
Couple mir building cleanups
|
|
Reduce FormattingOptions to 64 bits
This is part of https://github.com/rust-lang/rust/issues/99012
This reduces FormattingOptions from 6-7 machine words (384 bits on 64-bit platforms, 224 bits on 32-bit platforms) to just 64 bits (a single register on 64-bit platforms).
Before:
```rust
pub struct FormattingOptions {
flags: u32, // only 6 bits used
fill: char,
align: Option<Alignment>,
width: Option<usize>,
precision: Option<usize>,
}
```
After:
```rust
pub struct FormattingOptions {
/// Bits:
/// - 0-20: fill character (21 bits, a full `char`)
/// - 21: `+` flag
/// - 22: `-` flag
/// - 23: `#` flag
/// - 24: `0` flag
/// - 25: `x?` flag
/// - 26: `X?` flag
/// - 27: Width flag (if set, the width field below is used)
/// - 28: Precision flag (if set, the precision field below is used)
/// - 29-30: Alignment (0: Left, 1: Right, 2: Center, 3: Unknown)
/// - 31: Always set to 1
flags: u32,
/// Width if width flag above is set. Otherwise, always 0.
width: u16,
/// Precision if precision flag above is set. Otherwise, always 0.
precision: u16,
}
```
|
|
This seems to be the pattern for newer pal stdio types.
|
|
|
|
Match what `std::io::Empty` does, since it is very similar. However,
still evaluate the `fmt::Arguments` in `write_fmt` to be consistent with
other platforms.
|
|
merge opaque types defined in nested bodies
A small step towards https://github.com/rust-lang/types-team/issues/129
r? `@oli-obk`
|
|
|
|
This reverts commit 82af73dd4c58cd6bec5fb44cf02f7ac96b1ed48b.
|
|
Update cargo
14 commits in 6cf8267012570f63d6b86e85a2ae5627de52df9e..307cbfda3119f06600e43cd38283f4a746fe1f8b
2025-03-14 15:25:36 +0000 to 2025-03-20 20:00:39 +0000
- feat: Add custom completer for cargo <TAB> to complete aliases defined in config.toml (rust-lang/cargo#15319)
- fix(build-dir): Renamed workspace-manifest-path-hash to workspace-path-hash (rust-lang/cargo#15334)
- feat: vcs, color, and message format native completion (rust-lang/cargo#15322)
- Fix `[env]` `relative` description in reference (rust-lang/cargo#15332)
- chore: fix some typos (rust-lang/cargo#15329)
- Cleanup for rustc-link-arg-cdylib (rust-lang/cargo#15326)
- fix(toml): Report '<target>.edition' deprecation to users (rust-lang/cargo#15321)
- test(build-std): address overly-matched snapshot (rust-lang/cargo#15325)
- Added `build.build_dir` templating support (rust-lang/cargo#15236)
- docs: make it clearer that `rust_version` is enforced during compile (rust-lang/cargo#15303)
- feat: Add custom completer for cargo +<TAB> to complete toolchain name (rust-lang/cargo#15301)
- chore: fix some typos (rust-lang/cargo#15316)
- fix: deduplicate crate types in cargo rustc command (rust-lang/cargo#15314)
- docs: mention wrong URLs as a cause of git authentication errors (rust-lang/cargo#15304)
r? ghost
|
|
|
|
fixes #138565
|
|
Avoid no-op unlink+link dances in incr comp
Incremental compilation scales quite poorly with the number of CGUs. This PR improves one reason for that.
The incr comp process hard-links all the files from an old session into a new one, then it runs the backend, which may just hard-link the new session files into the output directory. Then codegen hard-links all the output files back to the new session directory.
This PR (perhaps unimaginatively) fixes the silliness that ensues in the last step. The old `link_or_copy` implementation would be passed pairs of paths which are already the same inode, then it would blindly delete the destination and re-create the hard-link that it just deleted. This PR lets us skip both those operations. We don't skip the other two hard-links.
`cargo +stage1 b && touch crates/core/main.rs && strace -cfw -elink,linkat,unlink,unlinkat cargo +stage1 b` before and then after on `ripgrep-13.0.0`:
```
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
52.56 0.024950 25 978 485 unlink
34.38 0.016318 22 727 linkat
13.06 0.006200 24 249 unlinkat
------ ----------- ----------- --------- --------- ----------------
100.00 0.047467 24 1954 485 total
```
```
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
42.83 0.014521 57 252 unlink
38.41 0.013021 26 486 linkat
18.77 0.006362 25 249 unlinkat
------ ----------- ----------- --------- --------- ----------------
100.00 0.033904 34 987 total
```
This reduces the number of hard-links that are causing perf troubles, noted in https://github.com/rust-lang/rust/issues/64291 and https://github.com/rust-lang/rust/issues/137560
|
|
Currently this cannot be inlined, which among other things means it
can't be used in `compiler-builtins` [1]. These are trivial functions
that should be inlineable, so add `#[inline]`.
[1]: https://github.com/rust-lang/compiler-builtins/pull/790#issuecomment-2744371738
|
|
Rollup of 9 pull requests
Successful merges:
- #138364 (ports the compiler test cases to new rust_intrinsic format)
- #138570 (add `naked_functions_target_feature` unstable feature)
- #138623 ([bootstrap] Use llvm_runtimes for compiler-rt)
- #138627 (Autodiff cleanups)
- #138669 (tests: accept some noise from LLVM 21 in symbols-all-mangled)
- #138706 (Improve bootstrap git modified path handling)
- #138709 (Update GCC submodule)
- #138717 (Add an attribute that makes the spans from a macro edition 2021, and fix pin on edition 2024 with it)
- #138721 (Use explicit cpu in some asm and codegen tests.)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
|