306288 Commits

Author SHA1 Message Date
Samuel Tardieu
e84b5ca1dd
Do not look for Cargo.toml inside target
This test, which checks that we do not define new profiles directly in
Clippy's multiple `Cargo.toml` files, must not look inside `target` as
`lintcheck` might place some third-party sources there. Of course those
third-party sources are allowed to define profiles in their `Cargo.toml`.
2025-09-17 18:56:25 +02:00
Samuel Tardieu
301092e249
Remove automatic feature freeze comment
The feature freeze period is over.
2025-09-17 18:46:08 +02:00
Alex Macleod
55570c9b25
Fix unnecessary_unwrap false negative (#12295) (#15689)
Fix `unnecessary_unwrap` false negative when unwrapping a known value
inside a macro call

Fixes rust-lang/rust-clippy#12295
Produces no changes to `lintcheck`

changelog: [`unnecessary_unwrap`]: Fix false negative when unwrapping a
known value inside a macro call

I made sue to run `cargo dev fmt`.
I also ran the following checks (in order) on a fresh clone of mi fork:
1. `cargo build`
2. `cargo test`
3. `cargo lintcheck`

Running `cargo test` after `lintcheck` causes a test to fail, but this
also happens on a clean fork without my changes
2025-09-17 15:03:50 +00:00
A4-Tacks
28b0e4e15e
Fix applicable on variant field for change_visibility
Enum variant fields do not allow visibility

Example
---
```rust
enum Foo {
    Variant($0String),
}
```

**Before this PR**:

```rust
enum Foo {
    Variant(pub(crate) String),
}
```

**After this PR**:

Assist not applicable
2025-09-17 22:57:25 +08:00
Chayim Refael Friedman
171812726d
Merge pull request #20583 from btj/comments-enable
Add `rust-analyzer.semanticHighlighting.comments.enable`
2025-09-17 14:06:17 +00:00
Marcelo Domínguez
e04567c363 Check ZST via PassMode 2025-09-17 13:58:17 +00:00
bors
5d1b897a07 Auto merge of #146331 - RalfJung:copy-prov-repeat, r=oli-obk
interpret: copy_provenance: avoid large intermediate buffer for large repeat counts

Copying provenance worked in this odd way where the "preparation" phase (which is supposed to just extract the necessary information from the source range) already did all the work of repeating the result N times for the target range. This was needed to use the existing `insert_presorted` function on `SortedMap`.

This PR generalizes `insert_presorted` so that we can avoid this odd structure on copy-provenance, and maybe even improve performance.
2025-09-17 13:56:54 +00:00
Bart Jacobs
6e101637fa Add the rust-analyzer.semanticHighlighting.comments.enable configuration value 2025-09-17 15:46:23 +02:00
dswij
f37b9c05ef
fix(transmute_ptr_to_ref): don't suggest .cast when to-type is DST (#15621)
Fixes https://github.com/rust-lang/rust-clippy/issues/13357

Determining the exact placement of the `if !to_ref_ty.is_sized()`s
required meticulously constructing the suggestion/truth table of
`is_sized`, `msrv.meets` and `has_erased_regions`. The test cases should
hopefully cover all the new combinations.

changelog: [`transmute_ptr_to_ref`]: don't suggest `.cast` when to-type
is DST
2025-09-17 13:41:48 +00:00
Tsukasa OI
a1a3cd0438 rustc_codegen_llvm: Reorder conversion cases
For maintainability, this commit reorders target feature conversion
cases by the architecture.
2025-09-17 12:35:21 +00:00
Tsukasa OI
d9f67cbb8b rustc_codegen_llvm: Simplify arch conversion
This commit simplifies construction of `arch` from `sess.target.arch`.
It also preserves a reference to `sess.target.arch` as `raw_arch`
to make this function future proof.
2025-09-17 12:35:21 +00:00
Tsukasa OI
ea8baccbb1 rustc_codegen_llvm: Name major version of LLVM
It makes LLVM version comparison clearer.
2025-09-17 12:35:21 +00:00
Zalathar
6b51f7c076 Use LLVMDIBuilderCreateTypedef 2025-09-17 22:32:22 +10:00
Zalathar
002771ab5c Use LLVMDIBuilderCreateQualifiedType 2025-09-17 22:32:22 +10:00
Zalathar
bb21dbeac7 Use LLVMDIBuilderCreateStaticMemberType 2025-09-17 22:32:22 +10:00
Zalathar
923d1be6b6 Use LLVMDIBuilderCreateMemberType 2025-09-17 22:32:21 +10:00
Marcelo Domínguez
0bf85d35ec Support ZST args 2025-09-17 12:11:27 +00:00
Manuel Drehwald
ef90d22dda update enzyme submodule 2025-09-17 20:04:57 +08:00
Marcelo Domínguez
8dbd1b014a doc and move single branch match to an if let 2025-09-17 12:01:22 +00:00
Marcelo Domínguez
466bec9029 Adjust autodiff actitivies for ScalarPair 2025-09-17 12:01:22 +00:00
Marcelo Domínguez
11107679ee Add test for autodiff abi handling 2025-09-17 12:01:22 +00:00
bors
ce6daf3d5a Auto merge of #142915 - cjgillot:dest-prop-default, r=saethlin
Enable DestinationPropagation by default

This PR proposes to perform destination propagation on MIR. Most of the pass was fully rewritten by `@JakobDegen` in rust-lang/rust#96451.

This pass is quite heavy, as it needs to perform and save the results of a full liveness dataflow analysis. This accounts for ~50% of the pass' runtime.

Perf sees a few decent savings in later llvm passes, but also sizeable régressions when there are no savings to balance this pass' runtime.
2025-09-17 10:44:22 +00:00
Oli Scherer
9e8e4afc70
Merge pull request #4590 from rust-lang/rustup-2025-09-17
Automatic Rustup
2025-09-17 08:21:47 +00:00
bors
2ebb1263e3 Auto merge of #146666 - Zalathar:rollup-m2b8low, r=Zalathar
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#142807 (libtest: expose --fail-fast as an unstable command-line option)
 - rust-lang/rust#144871 (Stabilize `btree_entry_insert` feature)
 - rust-lang/rust#145071 (Update the minimum external LLVM to 20)
 - rust-lang/rust#145181 (remove FIXME block from `has_significant_drop`, it never encounters inference variables)
 - rust-lang/rust#145660 (initial implementation of the darwin_objc unstable feature)
 - rust-lang/rust#145838 (don't apply temporary lifetime extension rules to non-extended `super let`)
 - rust-lang/rust#146259 (Suggest removing Box::new instead of unboxing it)
 - rust-lang/rust#146410 (Iterator repeat: no infinite loop for `last` and `count`)
 - rust-lang/rust#146460 (Add tidy readme)
 - rust-lang/rust#146552 (StateTransform: Do not renumber resume local.)
 - rust-lang/rust#146564 (Remove Rvalue::Len again.)
 - rust-lang/rust#146581 (Detect attempt to use var-args in closure)
 - rust-lang/rust#146588 (tests/run-make: Update list of statically linked musl targets)
 - rust-lang/rust#146631 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 3))

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-17 07:32:18 +00:00
The Miri Cronjob Bot
1672251dad Merge ref '3f1552a273e4' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 3f1552a273e43e15f6ed240d00e1efdd6a53e65e
Filtered ref: fbfa7b30a3ad5abd6a5db7e3ef15adc8da1ecc37
Upstream diff: 9d82de19df...3f1552a273

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-17 05:00:44 +00:00
Stuart Cook
4e6640be66
Rollup merge of #146631 - Zalathar:di-builder, r=nnethercote
cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 3)

- Part of rust-lang/rust#134001
- Follow-up to rust-lang/rust#136375
- Follow-up to rust-lang/rust#136632

---

This is another batch of LLVMDIBuilder binding migrations, replacing some our own LLVMRust bindings with bindings to upstream LLVM-C APIs.

This PR migrates all of the bindings that were touched by rust-lang/rust#136632, plus `LLVMDIBuilderCreateStructType`.
2025-09-17 14:56:49 +10:00
Stuart Cook
76f115942d
Rollup merge of #146588 - Gelbpunkt:musl-default-linking-test, r=jieyouxu
tests/run-make: Update list of statically linked musl targets

All of the tier 3 targets in the list now link dynamically by default (except `mips64el-unknown-linux-muslabi64`, I apparently overlooked that one in my PR that changed this).

Adjust the list of targets expected to link statically accordingly.

See also https://github.com/rust-lang/rust/pull/144410, which changed these targets.

Target by target:
- `mips64-unknown-linux-musl`: this target does not exist AFAICT
- `mips64-unknown-linux-muslabi64`: updated in the linked PR
- `powerpc-unknown-linux-musl`: updated in the linked PR
- `powerpc-unknown-linux-muslspe`: updated in the linked PR
- `powerpc64-unknown-linux-musl`: updated in the linked PR
- `riscv32gc-unknown-linux-musl`: updated in the linked PR
- `s390x-unknown-linux-musl`: updated in the linked PR
- `thumbv7neon-unknown-linux-musleabihf`: updated in the linked PR
2025-09-17 14:56:49 +10:00
Stuart Cook
61f53585aa
Rollup merge of #146581 - estebank:issue-146489, r=lcnr
Detect attempt to use var-args in closure

```
error: unexpected `...`
  --> $DIR/no-closure.rs:11:14
   |
LL |     let f = |...| {};
   |              ^^^ not a valid pattern
   |
   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list

error: unexpected `...`
  --> $DIR/no-closure.rs:16:17
   |
LL |     let f = |_: ...| {};
   |                 ^^^
   |
   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
```

Fix rust-lang/rust#146489, when trying to use c-style var-args in a closure. We emit a more targeted message. We also silence inference errors when the pattern is `PatKind::Err`.
2025-09-17 14:56:48 +10:00
Stuart Cook
6473a0f02d
Rollup merge of #146564 - cjgillot:mir-nolen, r=scottmcm
Remove Rvalue::Len again.

Now that we have `RawPtrKind::FakeForPtrMetadata`, we can reimplement `Rvalue::Len` using `PtrMetadata(&raw const (fake) place)`.

r? ``@scottmcm``
2025-09-17 14:56:48 +10:00
Stuart Cook
577f18ffe2
Rollup merge of #146552 - cjgillot:resume-noremap, r=jackh726
StateTransform: Do not renumber resume local.

MIR parameters are not explicitly assigned-to when entering the MIR body. If we want to save their values inside the coroutine state, we need to do so explicitly.

This was done by renaming the `_2` local, and introducing an explicit assignment pre-transform. This particular trick confuses me.

This version makes explicit that we are assigning parameters to saved locals.

r? ``@dingxiangfei2009``
2025-09-17 14:56:47 +10:00
Stuart Cook
c7af12ecc8
Rollup merge of #146460 - simp4t7:add-tidy-readme, r=clubby789
Add tidy readme

This PR adds a Readme to `src/tools/tidy`. Basically just explains how `tidy` works and covers all of tidy's checks, directives, and how to use tidy. I tried to add a bit more detail on some of the options like `--extra-checks` and the style directives that aren't really documented well elsewhere.

Planning to link to this in the dev guide.

Closes: rust-lang/rust#129368
2025-09-17 14:56:46 +10:00
Stuart Cook
cefd932520
Rollup merge of #146410 - hkBst:repeat-1, r=jhpratt
Iterator repeat: no infinite loop for `last` and `count`

This removes two cases of infinite looping from [`Repeat`](https://doc.rust-lang.org/nightly/std/iter/struct.Repeat.html):
- [`last`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.last): By viewing the iterator as returning None after [omega](https://en.wikipedia.org/wiki/Ordinal_number) calls to `next`, this method can simply return the repeated element.

- [`count`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.count): From its docs: """The method does no guarding against overflows, so counting elements of an iterator with more than [usize::MAX](https://doc.rust-lang.org/nightly/std/primitive.usize.html#associatedconstant.MAX) elements either produces the wrong result or panics. If overflow checks are enabled, a panic is guaranteed.""", so a panic'ing impl is allowed by the docs, and is more honest than an infinite loop.
2025-09-17 14:56:46 +10:00
Stuart Cook
79f8acb45b
Rollup merge of #146259 - camsteffen:remove-the-box, r=jackh726
Suggest removing Box::new instead of unboxing it
2025-09-17 14:56:45 +10:00
Stuart Cook
c2e8264b34
Rollup merge of #145838 - dianne:non-extending-super-let, r=jackh726,traviscross
don't apply temporary lifetime extension rules to non-extended `super let`

Reference PR: rust-lang/reference#1980

This changes the semantics for `super let` (and macros implemented in terms of it, such as `pin!`, `format_args!`, `write!`, and `println!`) as suggested by ````@theemathas```` in https://github.com/rust-lang/rust/issues/145784#issuecomment-3218658335, making `super let` initializers only count as [extending expressions](https://doc.rust-lang.org/nightly/reference/destructors.html#extending-based-on-expressions) when the `super let` itself is within an extending block. Since `super let` initializers aren't temporary drop scopes, their temporaries outside of inner temporary scopes are effectively always extended, even when not in extending positions; this only affects two cases as far as I can tell:
- Block tail expressions in Rust 2024. This PR makes `f(pin!({ &temp() }))` drop `temp()` at the end of the block in Rust 2024, whereas previously it would live until after the call to `f` because syntactically the `temp()` was in an extending position as a result of `super let` in `pin!`'s expansion.
- `super let` nested within a non-extended `super let` is no longer extended. i.e. a normal `let` is required to treat `super let`s as extending (in which case nested `super let`s will also be extending).

Closes rust-lang/rust#145784

This is a breaking change. Both static and dynamic semantics are affected. The most likely breakage is for programs to stop compiling, but it's technically possible for drop order to silently change as well (as in rust-lang/rust#145784). Since this affects stable macros, it probably would need a crater run.

Nominating for discussion alongside rust-lang/rust#145784: ````@rustbot```` label +I-lang-nominated +I-libs-api-nominated

Tracking issue for `super let`: rust-lang/rust#139076
2025-09-17 14:56:45 +10:00
Stuart Cook
6ad98750e0
Rollup merge of #145660 - jbatez:darwin_objc, r=jdonszelmann,madsmtm,tmandry
initial implementation of the darwin_objc unstable feature

Tracking issue: https://github.com/rust-lang/rust/issues/145496

This feature makes it possible to reference Objective-C classes and selectors using the same ABI used by native Objective-C on Apple/Darwin platforms. Without it, Rust code interacting with Objective-C must resort to loading classes and selectors using costly string-based lookups at runtime. With it, these references can be loaded efficiently at dynamic load time.

r? ```@tmandry```

try-job: `*apple*`
try-job: `x86_64-gnu-nopt`
2025-09-17 14:56:44 +10:00
Stuart Cook
f21a9c94cf
Rollup merge of #145181 - Borgerr:remove-fixme-from-has-sigdrop, r=lcnr
remove FIXME block from `has_significant_drop`, it never encounters inference variables

The `FIXME` block in `Ty::has_significant_drop` is outdated as related queries can now handle type inference.

321a89bec5/compiler/rustc_middle/src/ty/util.rs (L1378-L1389)

Closes rust-lang/rust#86868 (other places mentioned in the issue have been resolved, or moved to other issues)

r? types
2025-09-17 14:56:43 +10:00
Stuart Cook
f104ecfba6
Rollup merge of #145071 - cuviper:min-llvm-20, r=nikic
Update the minimum external LLVM to 20

With this change, we'll have stable support for LLVM 20 and 21.
For reference, the previous increase to LLVM 19 was rust-lang/rust#139275.

cc ```@rust-lang/wg-llvm```
r? nikic
2025-09-17 14:56:43 +10:00
Stuart Cook
feeb68eb5e
Rollup merge of #144871 - Kivooeo:btree_entry_insert-stabilize, r=jhpratt
Stabilize `btree_entry_insert` feature

This stabilises `btree_map::VacantEntry::insert_entry` and `btree_map::Entry::insert_entry`, following the FCP in [tracking issue](https://github.com/rust-lang/rust/issues/65225).

New stable API:

```rust
impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
    pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>;
}

impl<'a, K: Ord, V, A: Allocator + Clone> VacantEntry<'a, K, V, A> {
    pub fn insert_entry(mut self, value: V) -> OccupiedEntry<'a, K, V, A>;
}
```

(FCP ended almost a year ago, so if it's needed for process we could rerun it)

Closes: https://github.com/rust-lang/rust/issues/65225
2025-09-17 14:56:42 +10:00
Stuart Cook
9d93fab3a1
Rollup merge of #142807 - sourcefrog:failfast, r=dtolnay
libtest: expose --fail-fast as an unstable command-line option

This exposes the `fail_fast` option added in rust-lang/rust#105153 on the test harness command line, so that workflows that only want to know if any test fails can find out without waiting for everything to run. For example, cargo-mutants just needs to know if any tests fails. It only works with `-Zunstable-options`.

Tracking issue: rust-lang/rust#142859
2025-09-17 14:56:41 +10:00
The Miri Cronjob Bot
06e881042d Prepare for merging from rust-lang/rust
This updates the rust-version file to 3f1552a273e43e15f6ed240d00e1efdd6a53e65e.
2025-09-17 04:52:58 +00:00
bors
ba4b6437b3 Auto merge of #146656 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

19 commits in 24bb93c388fb8c211a37986539f24a819dc669d3..966f94733bbc94ca51ff9f1e4c49ad250ebbdc50
2025-09-10 23:16:07 +0000 to 2025-09-16 17:24:45 +0000
- fix(frontmatter): Improve error quality (rust-lang/cargo#15972)
- fix: wrong variable name in documentation (rust-lang/cargo#15968)
- Add "Optimizing Build Performance" section to the Cargo book (rust-lang/cargo#15924)
- Remove extra apostrophe in environment-variables.md (rust-lang/cargo#15963)
- Clarify warning for using `features` or `default-features` in `patch` (rust-lang/cargo#15953)
- fix(frontmatter): Try alternative len code fences (rust-lang/cargo#15952)
- feat(cli): Allow completions for third-party subcommand names (rust-lang/cargo#15961)
- docs(index): Clarify what we mean by omitting features (rust-lang/cargo#15957)
- fix(future): Report all content as a single Report (rust-lang/cargo#15943)
- fix(complete): Show local crates/features over other members  (rust-lang/cargo#15956)
- docs(resolver): Describe the role of the lockfile  (rust-lang/cargo#15958)
- chore: Skip check-version-bump ci job in forks (rust-lang/cargo#15959)
- Eliminate the last three "did you mean" warning phrasings (rust-lang/cargo#15356)
- fix(info): Suggest a more universal `cargo tree` command (rust-lang/cargo#15954)
- feat(cli): Use ellipses when truncating progress (rust-lang/cargo#15955)
- feat(completer): Added completion for `--features` flag (rust-lang/cargo#15309)
- fix(publish): Switch the 'ctrl-c on wait' line to a help message (rust-lang/cargo#15942)
- docs: move docs building process to contributor guide (rust-lang/cargo#15854)
- fix(manifest): Show error source to users (rust-lang/cargo#15939)

r? ghost
2025-09-17 04:17:06 +00:00
León Orell Valerian Liehr
34062b124f
Merge modules dyn_compatibility and lint into dyn_trait 2025-09-17 05:34:19 +02:00
León Orell Valerian Liehr
26f3337d4e
Remove DynKind 2025-09-17 04:46:46 +02:00
Zalathar
af88d14cac Use LLVMDIBuilderCreateStructType 2025-09-17 12:28:08 +10:00
Zalathar
bae6fde270 Use LLVMDIBuilderCreatePointerType 2025-09-17 12:28:08 +10:00
Zalathar
3e9048d9a4 Use LLVMDIBuilderCreateBasicType 2025-09-17 12:28:08 +10:00
Zalathar
bef8f646a6 Use LLVMDIBuilderCreateArrayType 2025-09-17 12:28:08 +10:00
Zalathar
2552deb9cd Use LLVMDIBuilderCreateUnionType 2025-09-17 12:28:08 +10:00
Zalathar
5419896111 Use LLVMDIBuilderCreateSubroutineType 2025-09-17 12:28:08 +10:00
Chayim Refael Friedman
ad19341ea9
Merge pull request #20379 from skewb1k/fix/consistent-hover-doc-breaks
fix(hover): unify horizontal rule formatting to `---`
2025-09-17 02:02:48 +00:00