Commit graph

308340 commits

Author SHA1 Message Date
ivmarkov
b1c212f850 Fix broken STD build for ESP-IDF 2025-10-01 08:12:44 +00:00
Marijn Schouten
86f2d424c8 indexing: reword help
Co-authored-by: beef <ent3rm4n@gmail.com>
2025-10-01 07:39:03 +00:00
Jakub Beránek
3186902bfc
Remove mention of compiletest-use-stage0-libtest from the bootstrap example config 2025-10-01 09:05:30 +02:00
Laurențiu Nicola
b18e9444d4
Merge pull request #20774 from lnicola/macos-14-x64
internal: Build x86_64-apple-darwin binaries on macos-14
2025-10-01 06:52:49 +00:00
Laurențiu Nicola
981da22e5e Bump MACOSX_DEPLOYMENT_TARGET to 14.0 2025-10-01 09:11:51 +03:00
Laurențiu Nicola
7a8a576329 Build x86_64-apple-darwin binaries on macos-14 2025-10-01 09:10:56 +03:00
Samuel Tardieu
f1079915b4
Do not suggest using a if let chain if it is not supported
This might be due to a low edition (< 2024) or too low a MSRV.
2025-10-01 07:41:49 +02:00
Jieyou Xu
ec893d1a64
tests: remove no-remap-src-base
Previously in the `//`-compiletest-directive times, this was implemented
as a special `no-*` directive parsing. In the migration from `//` ->
`//@`, the `// no-remap-src-base` directive was lost, most likely
because it had no effect -- the default is not remapping `src-base`.

So remove occurrences of `no-remap-src-base`, as these are not valid
directives.
2025-10-01 13:31:42 +08:00
A4-Tacks
3f0ae50c42
Fix not applicable match inside if for pull_assignment_up
Example
---
```rust
fn foo() {
    let x;
    if true {
        match true {
            true => $0x = 2,
            false => x = 3,
        }
    }
}
```

**Before this PR**:

Assist not applicable

**After this PR**:

```rust
fn foo() {
    let x;
    if true {
        x = match true {
            true => 2,
            false => 3,
        };
    }
}
```
2025-10-01 12:53:31 +08:00
bors
1e1a39441b Auto merge of #147198 - matthiaskrgr:rollup-b0ryvvu, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#143069 (Add fast-path for accessing the current thread id)
 - rust-lang/rust#146518 (Improve the documentation around `ZERO_AR_DATE`)
 - rust-lang/rust#146596 (Add a dummy codegen backend)
 - rust-lang/rust#146617 (Don’t suggest foreign `doc(hidden)` types in "the following other types implement trait" diagnostics)
 - rust-lang/rust#146635 (cg_llvm: Stop using `as_c_char_ptr` for coverage-related bindings)
 - rust-lang/rust#147184 (Fix the bevy implied bounds hack for the next solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-01 04:46:14 +00:00
Manuel Drehwald
de189fa982 updating tests to not break from new typetree metadata 2025-09-30 22:47:43 -04:00
Manuel Drehwald
28ffbab353 add empty struct ret testcase 2025-09-30 22:47:43 -04:00
Manuel Drehwald
ddbaca521e fix void and empty struct ret 2025-09-30 22:47:40 -04:00
Jana Dönszelmann
422f6bb742
enable tests on next-solver for rust-lang/trait-system-refactor-initiative/237 2025-10-01 01:11:12 +02:00
Jana Dönszelmann
c1318053e3
add test for trait-system-refactor-initiative/239 2025-10-01 00:47:58 +02:00
Alejandra González
e74d4bdc5d
clean-up match_same_arms a bit (#15727)
changelog: none
2025-09-30 22:03:03 +00:00
Jana Dönszelmann
bdebd479ac
remove outdated context (inner) infctx 2025-09-30 21:56:06 +02:00
Matthias Krüger
598ba1f65f
Rollup merge of #147184 - jdonszelmann:bevy-outlives-bound, r=lcnr
Fix the bevy implied bounds hack for the next solver

The diff is trivial, of course, and basically what you already suggested. Mostly dug around a bunch to learn. I hope this is roughly what you had in mind.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/236.

r? `@lcnr`
2025-09-30 21:53:35 +02:00
Matthias Krüger
b21c438eb5
Rollup merge of #146635 - Zalathar:llvm-cov, r=SparrowLii
cg_llvm: Stop using `as_c_char_ptr` for coverage-related bindings

[As explained by a note in `ffi.rs`](8a1b39995e/compiler/rustc_codegen_llvm/src/llvm/ffi.rs (L4-L11)), passing strings and byte slices through FFI is more convenient if we take advantage of the fact that `*const c_uchar` and `*const c_char` have the same ABI.

Doing so avoids having to rely on a special helper function, since we can just call `as_ptr` instead.

(The same logic applies to every other binding that currently uses the `as_c_char_ptr` helper; I just haven't adjusted all of them yet.)

---

As a drive-by change, this PR also marks some coverage-related FFI bindings as `safe`.
2025-09-30 21:53:35 +02:00
Matthias Krüger
014e0af149
Rollup merge of #146617 - Jules-Bertholet:E0277-NOFORN, r=SparrowLii
Don’t suggest foreign `doc(hidden)` types in "the following other types implement trait" diagnostics

Fixes https://github.com/rust-lang/rust/issues/132024.

``@rustbot`` label A-diagnostics T-compiler
2025-09-30 21:53:34 +02:00
Matthias Krüger
5a4713d8ea
Rollup merge of #146596 - bjorn3:dummy_backend, r=SparrowLii
Add a dummy codegen backend

This allows building a rustc capable of running the frontend without any backend present. While this may not seem all that useful, it allows running the frontend of rustc to report errors or running miri to interpret a program without any backend present. This is useful when you are trying to say run miri in the browser as upstream LLVM can't be compiled for wasm yet. Or to run rustc itself in miri like I did a while ago and caught some UB.
2025-09-30 21:53:33 +02:00
Matthias Krüger
0d78b1e657
Rollup merge of #146518 - madsmtm:ld-reproducible-doc, r=SparrowLii
Improve the documentation around `ZERO_AR_DATE`

In particular, document why we don't use the new `-reproducible` flag.

I went through [the source for Apple's old linker](https://github.com/apple-oss-distributions/ld64), and compared the versions with [the mapping to Xcode versions on Wikipedia](https://en.wikipedia.org/wiki/Xcode) to find the relevant Xcode versions for these features.

r? compiler
2025-09-30 21:53:33 +02:00
Matthias Krüger
3e621b3dbf
Rollup merge of #143069 - jsimmons:current-thread-id-accessor, r=joshtriplett,tgross35
Add fast-path for accessing the current thread id

Accessing the thread id is often used in profiling and debugging, as well as some approaches for sound single-threaded access to shared data.

Currently the only way to access the thread id is by first obtaining a handle to the current thread. While this is not exactly slow, it does require an atomic inc-ref and dec-ref operation, as well as the injection of `Thread`'s drop code into the caller.

This publicly exposes the existing fast-path for accessing the current thread id.

edit: ACP: https://github.com/rust-lang/libs-team/issues/650
2025-09-30 21:53:32 +02:00
Jana Dönszelmann
80e598bb12
clone region obligations instead of taking in implied bounds hack 2025-09-30 21:48:55 +02:00
bors
fa3155a644 Auto merge of #147197 - matthiaskrgr:rollup-du5e4pv, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#142506 (Add `Path::has_trailing_sep` and related methods)
 - rust-lang/rust#146886 (Add repr(align(2)) to RcInner and ArcInner)
 - rust-lang/rust#147166 (several small `proc_macro` cleanups)
 - rust-lang/rust#147172 (bootstrap: build bootstrap docs with in-tree rustdoc)
 - rust-lang/rust#147181 (cg_llvm: Replace enum `MetadataType` with a list of `MetadataKindId` constants)
 - rust-lang/rust#147187 (remove unnecessary test directives)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-30 19:41:53 +00:00
Samuel Tardieu
f08486481f
assertions_on_constants: Suggest using a const block when using a named constant (#15774)
changelog: [`assertions_on_constants`]: Suggest using a const block when
the assertion uses a named constant.
2025-09-30 19:40:20 +00:00
Yotam Ofek
2d03ab1486 Replace rustc_span::Span with a stripped down version for librustdoc's highlighter 2025-09-30 22:01:30 +03:00
Josh Simmons
cbaec31c10
Add fast-path for accessing the current thread id
Accessing the thread id is often used in profiling and debugging, as
well as some approaches for sound single-threaded access to data.

Currently the only way to access the thread id is by first obtaining a
handle to the current thread. While this is not exactly slow, it does
require an atomic inc-ref and dec-ref operation, as well as the
injection of `Thread`'s drop code into the caller.

This publicly exposes the existing fast-path for accessing the current
thread id.
2025-09-30 20:51:03 +02:00
Matthias Krüger
561e02cea0
Rollup merge of #147187 - lcnr:rarw, r=lqd
remove unnecessary test directives

that's... odd
2025-09-30 20:46:47 +02:00
Matthias Krüger
6e577e18c6
Rollup merge of #147181 - Zalathar:fixed-metadata, r=petrochenkov
cg_llvm: Replace enum `MetadataType` with a list of `MetadataKindId` constants

The metadata kind ID values declared in `MetadataType` are not part of the LLVM-C API, and are not machine-checked. If a value that we use ever goes out of sync with LLVM, the resulting bugs could be difficult to track down. And the existing values lack any clear indication of what LLVM declarations they correspond to.

On top of that, we currently have another way of expressing metadata kind IDs in the form of `MetadataKindId`, which creates confusing inconsistency in LLVM bindings.

This PR therefore consolidates all usage of “fixed” metadata kind IDs into one list of `MetadataKindId` constants, which is backed by static assertions in our C++ code that match them up with named anonymous-enum variants in `llvm::LLVMContext`.
2025-09-30 20:46:46 +02:00
Matthias Krüger
4cbaa70101
Rollup merge of #147172 - notriddle:tooldoc, r=Kobzol
bootstrap: build bootstrap docs with in-tree rustdoc

All of the docs need to be built with the same rustdoc. Otherwise, any change to the search index breaks everything, because the two rustdocs don't agree on the format.

Fixes https://github.com/rust-lang/rust/issues/147142
2025-09-30 20:46:46 +02:00
Matthias Krüger
622ca20e78
Rollup merge of #147166 - cyrgani:proc-macro-cleanup-1, r=petrochenkov
several small `proc_macro` cleanups
2025-09-30 20:46:45 +02:00
Matthias Krüger
f7c7e34ae4
Rollup merge of #146886 - taiki-e:rc-inner-align, r=Mark-Simulacrum
Add repr(align(2)) to RcInner and ArcInner

`Rc` currently assumes that `RcInner` has at least 2-byte alignment, but on AVR, `usize` has 1-byte alignment (this is because the AVR has 1-byte register sizes, so having 2-byte alignment is generally useless), breaking this assumption.

9f32ccf35f/library/alloc/src/rc.rs (L3005-L3008)

This PR adds `repr(align(2))` to force `RcInner` to always have at least 2-byte alignment.

Note that `ArcInner` doesn't need `repr(align(2))` because atomic types have the alignment same as its size. This PR adds a comment about this.
2025-09-30 20:46:45 +02:00
Matthias Krüger
61b9467af8
Rollup merge of #142506 - clarfonthey:path-trailing-sep, r=joboet
Add `Path::has_trailing_sep` and related methods

Implements rust-lang/libs-team#335.

Tracking issue: rust-lang/rust#142503

Notable differences from ACP:

* `trim_trailing_sep` was added to `Path` since it felt reasonable to ensure that the inverse operation was available.
* Per suggestion of `@kennytm,` added `push_trailing_sep` and `pop_trailing_sep` to `PathBuf` in addition to `set_trailing_sep`.

This also updates some of the docs on various `Path` methods to use the term "trailing separator" instead of "trailing slash" for consistency.
2025-09-30 20:46:44 +02:00
Yotam Ofek
6edf05b740 Add #[bench] for librustdoc's syntax highlighter 2025-09-30 21:13:45 +03:00
Jason Newcomb
61b1f0e37f assertions_on_constants: Don't suggest removing assertions with non-local constants. 2025-09-30 13:59:06 -04:00
Marijn Schouten
50398e2e75 iter repeat: add tests for new count and last behavior 2025-09-30 17:56:18 +00:00
Samuel Tardieu
d423321f72
Fix mem_replace_with_default wrongly unmangled macros (#15786)
Closes rust-lang/rust-clippy#15785

changelog: [`mem_replace_with_default`] fix wrongly unmangled macros
2025-09-30 17:32:42 +00:00
jackh726
1db4d8ebfd Split Bound into Canonical and Bound 2025-09-30 12:58:28 -04:00
jackh726
d1bbd39c59 Split Bound into Canonical and Bound 2025-09-30 12:58:28 -04:00
Alejandra González
8fafe7aa14
test: remove extraneous #[allow(clippy::uninlined_format_args)] (#15799)
These were probably added automatically to avoid code churn. I'd like to
get rid of them bit by bit, so here's the first bit

changelog: none
2025-09-30 16:44:44 +00:00
yanglsh
f9852613a9 fix: mem_replace_with_default wrongly unmangled macros 2025-10-01 00:33:32 +08:00
Ada Alakbarova
e9ede27a5d
test: remove extraneous #[allow(clippy::uninlined_format_args)]
These were probably added automatically to avoid code churn. I'd like to
get rid of them bit by bit, so here's the first bit
2025-09-30 18:08:37 +02:00
Ada Alakbarova
b3219502d7
map_identity: simplify lint emission
Instead of calling `span_lint_and_*` in multiple places, call
`span_lint_and_then` once and then use the `Diag` methods.
2025-09-30 18:02:31 +02:00
Chayim Refael Friedman
b19df97543 Prevent rustup from automatically installing toolchains
By setting RUSTUP_AUTO_INSTALL=0.
2025-09-30 19:02:10 +03:00
Ada Alakbarova
195ff236c3
new_ret_no_self: extract to a separate module 2025-09-30 18:01:09 +02:00
yanglsh
089fbd35aa fix: let_unit_value suggests wrongly for field init shorthand 2025-09-30 23:51:17 +08:00
Chayim Refael Friedman
ca0f3d16c4 Ignore impl trait safety errors when the trait is unresolved 2025-09-30 18:48:54 +03:00
bors
42d009c0a9 Auto merge of #147186 - Zalathar:rollup-sza9wxl, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#140916 (Fix unuseful span in type error in some format_args!() invocations)
 - rust-lang/rust#146011 (Point at fn bound that introduced lifetime obligation)
 - rust-lang/rust#146649 (cmse: fix 'region variables should not be hashed')
 - rust-lang/rust#147109 (Rename various "concrete opaque type" things to say "hidden type")
 - rust-lang/rust#147167 (Don't condition RUSTDOC_LIBDIR on `--no-doc`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-30 15:32:50 +00:00
Michael Howell
ba13b6ec6f bootstrap: build bootstrap docs with in-tree rustdoc
All of the docs need to be built with the same rustdoc. Otherwise,
any change to the search index breaks everything, because the two
rustdocs don't agree on the format.
2025-09-30 08:31:08 -07:00