Commit graph

308690 commits

Author SHA1 Message Date
Stuart Cook
2e575e0022
Rollup merge of #147866 - fee1-dead-contrib:constclonebuiltin, r=lcnr
Add built-in `const` impls for `Clone` and `Copy`

cc `@compiler-errors`
2025-10-27 22:13:22 +11:00
Stuart Cook
0bd2437cac
Rollup merge of #147478 - Jamesbarford:fix/tuple-private-fields-constructor, r=davidtwco
More intuitive error when using self to instantiate tuple struct with private field

Fixes https://github.com/rust-lang/rust/issues/147343
2025-10-27 22:13:21 +11:00
Stuart Cook
537a778ac3
Rollup merge of #145939 - clarfonthey:const-select-unpredictable, r=oli-obk
const `select_unpredictable`

Tracking issue: rust-lang/rust#145938
2025-10-27 22:13:21 +11:00
bors
34a8c7368c Auto merge of #148163 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 049767e6fa.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-10-27 07:56:13 +00:00
bors
23fced0fcc Auto merge of #146069 - camsteffen:range-desugar-span, r=SparrowLii
Mark desugared range expression spans with DesugaringKind::RangeExpr

This is a prerequisite to removing `QPath::LangItem` (rust-lang/rust#115178) because otherwise there would be no way to detect a range expression in the HIR.

There are some non-obvious Clippy changes so a Clippy team review would be good.
2025-10-27 02:50:35 +00:00
ltdk
6f649e4e1a const select_unpredictable 2025-10-26 21:33:00 -04:00
bors
b1b464d6f6 Auto merge of #147914 - petrochenkov:oosmc-used, r=fmease
resolve: When suppressing `out_of_scope_macro_calls` suppress `unused_imports` as well

Fixes the example from this comment - https://github.com/rust-lang/rust/issues/147823#issuecomment-3421770900.
Fixes https://github.com/rust-lang/rust/issues/148143.
2025-10-26 23:44:52 +00:00
bors
f37aa9955f Auto merge of #147890 - tmiasko:deduce-captures-none, r=cjgillot
Deduce captures(none) for a return place and parameters

Extend attribute deduction to determine whether parameters using
indirect pass mode might have their address captured. Similarly to
the deduction of `readonly` attribute this information facilitates
memcpy optimizations.
2025-10-26 20:37:03 +00:00
Deadbeef
042018df2d respond to review 2025-10-26 19:57:05 +00:00
Deadbeef
744c670812 Add built-in const impls for Clone and Copy 2025-10-26 19:40:59 +00:00
Chayim Refael Friedman
f7c1ad66cb
Merge pull request #20914 from ShoyuVanilla/next-solver-tests
Add regression tests for some fixed `A-ty` issues
2025-10-26 17:41:19 +00:00
bors
f977dfc388 Auto merge of #146992 - GuillaumeGomez:improve-highlight, r=yotamofek,lolbinarycat
Improve source code for `highlight.rs`

I was very bothered by the complexity of this file, in particular the handling of `pending_elems` which was very tricky to follow.

So instead, here comes a more sane approach: the content is store in a stack-like type which handles "levels" of HTML (ie, a macro expansion can contain other HTML tags which can themselves contain other, etc). Making it much simpler to keep track of what's going on.

r? `@lolbinarycat`
2025-10-26 17:31:22 +00:00
Shoyu Vanilla
85b7d646cd Add regression tests for some fixed A-ty issues 2025-10-27 02:18:52 +09:00
Shoyu Vanilla (Flint)
f62cb389c4
Merge pull request #20913 from A4-Tacks/if-let-chain-for-is-method-with-if-let
Fix not applicable on let-chain for replace_is_method_with_if_let_method
2025-10-26 14:48:02 +00:00
bors
2888098522 Auto merge of #148003 - aDotInTheVoid:rustdoc-postcard-compiletest-groundwork, r=jieyouxu
compiletest: pass rustdoc mode as param, rather than implicitly

Spun out of https://github.com/rust-lang/rust/pull/142642

In the future, I want the rustdoc-json test suite to invoke rustdoc twice, once with `--output-format=json`, and once with the (not yet implemented) `--output-format=postcard` flag.

Doing that requires being able to explicitly tell the `.document()` function which format to use, rather then implicitly using json in the rustdoc-json suite, and HTML in all others.

r? `@jieyouxu`

CC `@jalil-salame`
2025-10-26 14:24:14 +00:00
Lukas Wirth
165065ae1e
Merge pull request #20837 from osdyne/extension-configuration
Add an Extension Config API
2025-10-26 12:34:05 +00:00
Michael Gruenewald
ce94044ff9 Don't add cargo to requiresServerReloadOpts 2025-10-26 13:22:52 +01:00
A4-Tacks
95e2b8444a
Fix not applicable on let-chain for replace_is_method_with_if_let_method
Example
---
```rust
fn main() {
    let x = Some(1);
    let cond = true;
    if cond && x.is_som$0e() {}
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn main() {
    let x = Some(1);
    let cond = true;
    if cond && let Some(${0:x1}) = x {}
}
```
2025-10-26 19:55:09 +08:00
bors
58b4453fbd Auto merge of #148136 - Zalathar:rollup-73hkwv8, r=Zalathar
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#148118 (Improve the ICE message for invalid nullary intrinsic calls)
 - rust-lang/rust#148134 (Add myself as a windows-msvc maintainer)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-26 11:17:09 +00:00
Stuart Cook
cdacfb8158
Rollup merge of #148134 - Fulgen301:maintainer, r=Noratrieb
Add myself as a windows-msvc maintainer

As mentioned on the RPLCS Discord, I'd like to become a maintainer for windows-msvc.

r? `@jieyouxu`
2025-10-26 22:15:09 +11:00
Stuart Cook
3bf838d790
Rollup merge of #148118 - saethlin:nullary-intrinsic-check-bug-msg, r=Noratrieb,dianqk
Improve the ICE message for invalid nullary intrinsic calls

In https://github.com/rust-lang/rust/issues/148104, we found the panic message here rather confusing, and (if I'm reading the tea leaves right) that's because the intended audience for either side of the phrase is very different. I think this is more clear if/when this is encountered by users.

I expect this ICE to be hit in practice by people calling the `size_of` and `align_of` intrinsics, so it's now _kind of_ helpful for those users too.

The original effort to stop backends from needing to support nullary intrinsics added a note to all these const-only intrinsics, but when https://github.com/rust-lang/rust/pull/147793 ported two more the paragraph wasn't added. I've added it.
2025-10-26 22:15:09 +11:00
George Tokmaji
e873f13454 Add myself as a windows-msvc maintainer 2025-10-26 10:58:04 +01:00
Lukas Wirth
3145078e66
Merge pull request #19918 from A4-Tacks/remove-else-branches
Add ide-assist: remove else branches
2025-10-26 08:35:08 +00:00
Lukas Wirth
64326b2d6a
Merge pull request #20589 from A4-Tacks/extract-mod-not-in-impl
Fix extract multiple item in impl for extract_module
2025-10-26 08:25:00 +00:00
Lukas Wirth
dbfbe8f742
Merge pull request #20712 from A4-Tacks/destruct-tuple-shorthand
Fix shorthand field pat for destructure_tuple_binding
2025-10-26 08:18:40 +00:00
Lukas Wirth
10066b373b
Merge pull request #20705 from A4-Tacks/flip-range
Add ide-assist: flip_range_expr
2025-10-26 08:17:15 +00:00
Lukas Wirth
6c18a87141
Merge pull request #20764 from A4-Tacks/fix-guarded-rhs-let-else
Fix let-expr in lhs for convert_to_guarded_return
2025-10-26 08:06:08 +00:00
Lukas Wirth
9c7db53595
Merge pull request #20912 from A4-Tacks/left-side-in-cond
Fix not complete `let` before expr in condition
2025-10-26 07:19:04 +00:00
bors
a8664a1534 Auto merge of #145665 - GrigorenkoPV:144707, r=tgross35
Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe`

Closes rust-lang/rust#144707

r? t-libs-api
2025-10-26 06:35:34 +00:00
bors
e5177985a5 Auto merge of #147818 - rperier:unify_and_dedup_max_recip_float_tests, r=tgross35
Unify and deduplicate max recip float tests

cc rust-lang/rust#141726

This is a proposal to unify and deduplicate max recip tests for f16 and f128
2025-10-26 02:12:06 +00:00
Ben Kimock
7a0d9c8d5e Improve the ICE message for invalid nullary intrinsic calls 2025-10-25 21:32:27 -04:00
bors
cc63a0abde Auto merge of #148066 - lcnr:remove-perf-hack, r=BoxyUwU
remove a performance hack

This hack seems no longer used 🤔 nalgebra compiles without it.

Let's run perf to see whether it matters.

r? `@BoxyUwU`
2025-10-25 22:23:29 +00:00
James Barford-Evans
7af72e79b9 More intuitive error when using self to instantiate tuple struct with private field 2025-10-25 22:46:15 +01:00
Tomasz Miąsko
2a03a948b9 Deduce captures(none) for a return place and parameters
Extend attribute deduction to determine whether parameters using
indirect pass mode might have their address captured. Similarly to
the deduction of `readonly` attribute this information facilitates
memcpy optimizations.
2025-10-25 22:53:52 +02:00
bors
34f954f9b7 Auto merge of #148100 - matthiaskrgr:rollup-vrd4wy8, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#143361 (Stop passing resolver disambiguator state to AST lowering.)
 - rust-lang/rust#148000 (Improvements to attribute suggestions)
 - rust-lang/rust#148007 (chore: Update to the latest annotate-snippets)
 - rust-lang/rust#148088 (compiletest: Simplify passing arguments to spawned test threads)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-25 19:10:39 +00:00
Chayim Refael Friedman
ad63c71652
Merge pull request #20759 from A4-Tacks/strongly-typed-conv-to-guarded
Fix untyped syntax tree ans casts for convert_to_guarded_return
2025-10-25 17:14:53 +00:00
bors
79966ae420 Auto merge of #147493 - cjgillot:single-pin, r=oli-obk
StateTransform: Only load pin field once.

The current implementation starts by transforming all instances of `_1` into `(*_1)`, and then traverses the body again to transform `(*_1)` into `(*(_1.0))`, and again for `Derefer`.

This PR changes the implementation to only traverse the body once. As `_1.0` cannot be not modified inside the body (we just changed its type!), we have no risk of loading from the wrong pointer.
2025-10-25 16:04:41 +00:00
Romain Perier
70876ee42b Unify and deduplicate max recip float tests 2025-10-25 17:57:06 +02:00
Matthias Krüger
d4f0f3537a
Rollup merge of #148088 - Zalathar:test-thread, r=jieyouxu
compiletest: Simplify passing arguments to spawned test threads

The current code structure was heavily influenced by wanting to match the libtest executor as closely as possible.

Now that the libtest executor has been removed, we can get rid of some complexity that no longer serves a purpose in the new executor.

---

The renaming of `ShouldPanic` is only semi-related, but I included it here because it's small, and as a separate PR it would have conflicted with this one.

r? jieyouxu
2025-10-25 12:57:40 +02:00
Matthias Krüger
141c91091c
Rollup merge of #148007 - Muscraft:annotate-snippets, r=jdonszelmann
chore: Update to the latest annotate-snippets

This PR updates `annotate-snippets` to the latest version and updates the adapter code[^1] so that `AnnotateSnippetEmitter`'s output matches `HumanEmitter`'s output. If anyone would like to see the differences[^2] between `AnnotateSnippetEmitter` and `HumanEmitter`, [I have a branch](https://github.com/Muscraft/rust/tree/annotate-snippets-default-renderer) where `AnnotateSnippetEmitter` is used in place of `HumanEmitter`.

[^1]: A lot of the adapter code changes are based on code for `HumanEmitter`.
[^2]: Some of the test differences will go away when rust-lang/rust#148001 and rust-lang/rust#148004 are merged.
2025-10-25 12:57:39 +02:00
Matthias Krüger
d182d8e874
Rollup merge of #148000 - JonathanBrouwer:wipnew2, r=jdonszelmann
Improvements to attribute suggestions

Changes in commit 1:
- Add `AcceptContext::suggestions`, which retrieves the suggestions for the currently parsing attribute
- This happens to fix a bug in the way `#[macro_export`]. Closes https://github.com/rust-lang/rust/pull/147987

Changes in commit 2:
- Add a check to the suggestions function so the suggestions for attributes in cfg_attr are nicer. Fixes https://github.com/rust-lang/rust/issues/147693

This is also part (but not all) of the changes needed to unblock https://github.com/rust-lang/rust/pull/147945

r? `@jdonszelmann`
2025-10-25 12:57:39 +02:00
Matthias Krüger
cee562c0b2
Rollup merge of #143361 - cjgillot:split-disambig, r=oli-obk
Stop passing resolver disambiguator state to AST lowering.

AST->HIR lowering can use a disjoint set of `DefPathData` as the resolver, so we don't need to pass the disambiguator state.

r? `@oli-obk`
2025-10-25 12:57:38 +02:00
bors
04ff05c9c0 Auto merge of #148090 - jhpratt:rollup-n260hcy, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#147406 (Remove needs-asm-support directive in tests with explicit targets)
 - rust-lang/rust#148056 (refactor(rustdoc): Remove redundant langstr checks)
 - rust-lang/rust#148065 (compiletest: Add concrete examples for some config/test path fields)
 - rust-lang/rust#148072 (Fix compiling `CondVar::wait_timeout` on 32-bit Apple platforms)
 - rust-lang/rust#148073 (test(frontmatter): Rename tests to make coverage more obvious)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-25 07:52:52 +00:00
A4-Tacks
5fda166acf
Fix not complete let before expr in condition
Example
---
```rust
fn f() {
    if $0foo.bar() {}
}
```

**Before this PR**

"let" not in completion list

**After this PR**

```rust
fn f() {
    if let $1 = $0foo.bar() {}
}
```
2025-10-25 15:24:37 +08:00
Shoyu Vanilla (Flint)
3c3fcdf103
Merge pull request #20911 from chenyukang/yukang-fix-never-panic
Use tracing error when received compiler message for unknown package
2025-10-25 05:37:52 +00:00
A4-Tacks
e0fd5743f9
Fix untyped syntax tree ans casts for convert_to_guarded_return 2025-10-25 13:16:57 +08:00
Jacob Pratt
3e3e08c738
Rollup merge of #148073 - epage:org-frontmatter, r=jieyouxu
test(frontmatter): Rename tests to make coverage more obvious

When working on the stabilization report (rust-lang/rust#148051), I found it annoying to determine what cases were covered because areas of the frontmatter feature were either not in the file name or in inconsistent locations.

This moves the area of frontmatter to the start of the file name and the moves to more specific the later in the file name so coverage is easier to see.

Tracking issue: rust-lang/rust#136889
2025-10-25 00:40:38 -04:00
Jacob Pratt
0462a3883f
Rollup merge of #148072 - madsmtm:fix-apple-condvar-32bit, r=joboet
Fix compiling `CondVar::wait_timeout` on 32-bit Apple platforms

Fixes https://github.com/rust-lang/rust/issues/147776. I feel like there's a cleaner way to write this, but that probably requires further refactoring.

The build can be tested with `./x build --target arm64_32-apple-watchos` (or with any other 32-bit Apple target).

Tested it works at runtime on an Intel Macbook Pro with macOS 10.12.6, in x86 emulation mode with something similar to `./x test library/std --target x86_64-apple-darwin,i686-apple-darwin`, as well as with a custom test with a timeout of `Duration::from_secs((u32::MAX as u64) + 1)` (which the naive fix would have treated as a duration of 1 second).

r? libs
CC ``@joboet``
2025-10-25 00:40:37 -04:00
Jacob Pratt
0b7fbc5358
Rollup merge of #148065 - Zalathar:test-paths, r=jieyouxu
compiletest: Add concrete examples for some config/test path fields

Seeing a specific example path can be much more enlightening than trying to figure out what the prose is gesturing towards.

Also, in some cases the existing comments were incorrect or misleading, as demonstrated by the example paths.

The example paths were determined by dumping them directly out of the config with `dbg!`, and then lightly anonymizing them for example purposes.

---

No functional changes.

r? jieyouxu
2025-10-25 00:40:36 -04:00
Jacob Pratt
db5b48762f
Rollup merge of #148056 - epage:merged, r=GuillaumeGomez
refactor(rustdoc): Remove redundant langstr checks

These same checks feed into `doctest.can_be_merged`, making them redundant.
2025-10-25 00:40:36 -04:00