Skip to content

Rustc pull update#2090

Merged
sayantn merged 12 commits intomainfrom
rustc-pull
Apr 20, 2026
Merged

Rustc pull update#2090
sayantn merged 12 commits intomainfrom
rustc-pull

Conversation

@workflows-stdarch
Copy link
Copy Markdown

Latest update from rustc.

bors and others added 12 commits April 2, 2026 00:09
Explicitly forget the zero remaining elements in `vec::IntoIter::fold()`.



[Original description:] ~~This seems to help LLVM notice that dropping the elements in the destructor of `IntoIter` is not necessary. In cases it doesn’t help, it should be cheap since it is just one assignment.~~

This PR adds a function to `vec::IntoIter()` which is used used by `fold()` and `spec_extend()`, when those operations complete, to forget the zero remaining elements and only deallocate the allocation, ensuring that there will never be a useless loop to drop zero remaining elements when the iterator is dropped.

This is my first ever attempt at this kind of codegen micro-optimization in the standard library, so please let me know what should go into the PR or what sort of additional systematic testing might indicate this is a good or bad idea.
add llvm writable attribute conditionally




This PR tries to address rust-lang/unsafe-code-guidelines#584 (comment). It is part of a bachelor thesis supervised by @JoJoDeveloping and @RalfJung, for more information, see: [Project_Description.pdf](https://github.com/user-attachments/files/26537277/Project_Description.pdf).
If the new `-Zllvm-writable` flag is set, the [llvm writable attribute](https://llvm.org/docs/LangRef.html#writable) is inserted for all mutable borrows. This can be conditionally turned off on a per-function basis using the `#[rustc_no_writable]` attribute. The new Undefined Behaviour introduced by this can detected by Miri, which is implemented here: rust-lang/miri#4947.

Two library functions already received the `#[rustc_no_writable]` attribute, as they are known to cause problems under the Tree Borrows aliasing model with implicit writes enabled.
Clippy subtree update

r? Manishearth 

`Cargo.lock` update due to Clippy version bump and cargo_metadata dep bump in Clippy.
…miasko,cjgillot,saethlin

Remove fewer Storage calls in CopyProp and GVN



Modify the CopyProp and GVN MIR optimization passes to remove fewer `Storage{Live,Dead}` calls, allowing for better optimizations by LLVM - see rust-lang/rust#141649.

### Details

The idea is to use a new `MaybeUninitializedLocals` analysis and remove only the storage calls of locals that are maybe-uninit when accessed in a new location.
Refactor FnDecl and FnSig non-type fields into a new wrapper type





#### Why this Refactor?

This PR is part of an initial cleanup for the [arg splat experiment](rust-lang/rust#153629), but it's a useful refactor by itself.

It refactors the non-type fields of `FnDecl`, `FnSig`, and `FnHeader` into a new packed wrapper types, based on this comment in the `splat` experiment PR:
rust-lang/rust#153697 (comment)

It also refactors some common `FnSig` creation settings into their own methods. I did this instead of creating a struct with defaults.

#### Relationship to `splat` Experiment

I don't think we can use functional struct updates (`..default()`) to create `FnDecl` and `FnSig`, because we need the bit-packing for the `splat` experiment.

Bit-packing will avoid breaking "type is small" assertions for commonly used types when `splat` is added.
This PR packs these types:
- ExternAbi: enum + `unwind` variants (38) -> 6 bits
- ImplicitSelfKind: enum variants (5) -> 3 bits
- lifetime_elision_allowed, safety, c_variadic: bool -> 1 bit

#### Minor Changes

Fixes some typos, and applies rustfmt to clippy files that got skipped somehow.
Update cargo submodule

28 commits in eb94155a9a60943bd7b1cb04abec42f5d0de6ddc..7ecf0285ebb408d596e4a8ac76a0980d8edb7005
2026-04-09 13:10:20 +0000 to 2026-04-18 15:34:11 +0000
- fix: use `portable-atomic` for 64-bit atomics (rust-lang/cargo#16906)
- fix: rename incorrectly documented target-spec-json to json-target-sp… (rust-lang/cargo#16905)
- Add global HTTP timeout tracking to http_async (rust-lang/cargo#16903)
- feat(config): Stabilize `resolver.lockfile-path` config (rust-lang/cargo#16694)
- chore(deps): update msrv (1 version) to v1.95 (rust-lang/cargo#16897)
- fix: rebuild rustdoc json for different versions of a same crate (rust-lang/cargo#16773)
- Add effective_url to http_async (rust-lang/cargo#16899)
- Make crate downloads process as a queue rather than a stack (rust-lang/cargo#16898)
- fix: sparse registry fetch progress reporting (rust-lang/cargo#16900)
- chore: bump to 0.98.0; update changelog (rust-lang/cargo#16892)
- docs(semver-check): update diagnostics to Rust 1.95 (rust-lang/cargo#16895)
- docs(ref): Better highlight 'package --list' for include/exclude (rust-lang/cargo#16891)
- docs: `include` doesnt apply gitignore from repo (rust-lang/cargo#16890)
- fix: Update `bash` and `zsh` Autocompletion Documents to add `-m` (rust-lang/cargo#16888)
- Add `-m` shorthand for `--manifest-path` (rust-lang/cargo#16858)
- Fix a typo (rust-lang/cargo#16885)
- Always take a shared lock on `.cargo-lock` (rust-lang/cargo#16886)
- fix(toml): Teach users how to pin edition (rust-lang/cargo#16851)
- fix: Prefer defined lint levels over default (rust-lang/cargo#16879)
- chore(deps): bump rand from 0.10.0 to 0.10.1 (rust-lang/cargo#16883)
- fix(lints): Ignore unused_crate_dependencies status (rust-lang/cargo#16877)
- Copy cargo clean target-dir validation tests to clean_new_layout.rs (rust-lang/cargo#16878)
- cargo clean: Add target directory validation (rust-lang/cargo#16712)
- Docs: "api" in the configuration should not include a trailing slash (rust-lang/cargo#16869)
- fix(core): use `closest_msg` to suggest similar member name for mistyped `-p` (rust-lang/cargo#16844)
- chore(ci): Pin GitHub Actions to commit SHAs (rust-lang/cargo#16868)
- chore(ci): Update `actions/checkout` from v5 to v6 (rust-lang/cargo#16867)
- Add test for cargo install with github fastpath (rust-lang/cargo#16866)
Update a bunch of dependencies to reduce windows-sys duplication

This gets rid of windows-sys 0.60 and with the exception of curl and stacker it gets rid of windows-sys 0.59. For stacker getting rid of windows-sys 0.59 is blocked on rust-lang/stacker#145 and rust-lang/rust#155438.
This updates the rust-version file to e22c616e4e87914135c1db261a03e0437255335e.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

r? @sayantn

rustbot has assigned @sayantn.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @folkertdev, @sayantn
  • @Amanieu, @folkertdev, @sayantn expanded to Amanieu, folkertdev, sayantn
  • Random selection from Amanieu, folkertdev, sayantn

@sayantn sayantn added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit d9ee32c Apr 20, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants