35104 Commits

Author SHA1 Message Date
Wilfred Hughes
e7ae13368b [minor] Fix typos 2025-06-10 13:22:03 +01:00
Lukas Wirth
f15267aaf4
Merge pull request #19963 from ChayimFriedman2/unsized-impl-items
fix: Do not error at impls for unsized types that do not include `where Self: Sized` items
2025-06-10 11:37:30 +00:00
Chayim Refael Friedman
6f4a6d4349 Do not error at impls for unsized types that do not include where Self: Sized items 2025-06-10 14:04:21 +03:00
bors
a6756f1c38 Auto merge of #141451 - lcnr:canonicalize-env-cache, r=compiler-errors
cache `param_env` canonicalization

BLocked on rust-lang/rust#141581
2025-06-10 10:42:35 +00:00
Ralf Jung
ebfd3a63ae
Merge pull request #4382 from RalfJung/dup
test_dup: ensure the FDs remain in sync even after dup'ing
2025-06-10 09:11:22 +00:00
bors
75b6950542 Auto merge of #142109 - weihanglo:update-cargo, r=weihanglo
Update cargo

18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51
2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000
- fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640)
- Update "time out" to "timeout" (rust-lang/cargo#15637)
- fix(workspace): reload current manifest path member only (rust-lang/cargo#15633)
- Update dependencies (rust-lang/cargo#15635)
- fix(publish): Don't tell people to ctrl-c without knowing consequences  (rust-lang/cargo#15632)
- refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631)
- fix(package): Skip registry check if its not needed (rust-lang/cargo#15629)
- Add --offline for comp (rust-lang/cargo#15623)
- cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295)
- test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628)
- fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626)
- docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572)
- Remove double reference in Shell::print_json (rust-lang/cargo#15460)
- fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614)
- test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621)
- fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617)
- Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281)
- chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616)

r? ghost
2025-06-10 05:56:54 +00:00
bors
d9094b2583 Auto merge of #142250 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-10 01:52:18 +00:00
bors
c15c655f72 Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung
Enable Non-determinism of float operations in Miri and change std tests

Links to [#4208](https://github.com/rust-lang/miri/issues/4208) and [#3555](https://github.com/rust-lang/miri/issues/3555) in Miri.

Non-determinism of floating point operations was disabled in rust-lang/rust#137594 because it breaks the tests and doc-tests in core/coretests and std. This PR enables some of them.

This pr includes the following changes:

- Enables the float non-determinism but with a lower relative error of 4ULP instead of 16ULP
- These operations now have a fixed output based on the C23 standard, except the pow operations, this is tracked in [#4286](https://github.com/rust-lang/miri/issues/4286#issue-3010677983)
- Changes tests that made incorrect assumptions about the operations, not to make that assumption anymore (from `assert_eq!` to `assert_approx_eq!`.
- Changed the doctests of the stdlib of these operations to compare against fixed constants instead of `f*::EPSILON`, which now succeed with Miri and `-Zmiri-many-seeds`
- Added a constant `APPROX_DELTA` in `std/tests/floats/f32.rs` which is used for approximation tests, but with a different value when run in Miri. This is to make these tests succeed.
- Added tests in the float tests of Miri to test the C23 behaviour.

Fixes https://github.com/rust-lang/miri/issues/4208
2025-06-09 21:21:58 +00:00
David Barsky
bf6d445810
Merge pull request #19930 from regexident/dyn-semantics-take-two
Make `Semantics<'db, DB>` support `Semantics<'db, dyn HirDatabase>`, take two
2025-06-09 18:18:49 +00:00
Ralf Jung
0c876108c3
Merge pull request #4376 from yoctocell/tb-interior-mut-flag
TB: Add flag to disable the more precise interior mutability tracking
2025-06-09 15:50:19 +00:00
Laurențiu Nicola
64bc6b2299
Merge pull request #19954 from lnicola/sync-from-rust
minor: Sync from downstream
2025-06-09 12:55:47 +00:00
Laurențiu Nicola
273514a9fb Merge from rust-lang/rust 2025-06-09 15:44:40 +03:00
Laurențiu Nicola
232c05e29a Preparing for merge from rust-lang/rust 2025-06-09 15:44:03 +03:00
bors
442f110650 Auto merge of #141435 - RalfJung:unsupported_calling_conventions, r=workingjubilee
Add (back) `unsupported_calling_conventions` lint to reject more invalid calling conventions

This adds back the `unsupported_calling_conventions` lint that was removed in https://github.com/rust-lang/rust/pull/129935, in order to start the process of dealing with https://github.com/rust-lang/rust/issues/137018. Specifically, we are going for the plan laid out [here](https://github.com/rust-lang/rust/issues/137018#issuecomment-2672118326):
- thiscall, stdcall, fastcall, cdecl should only be accepted on x86-32
- vectorcall should only be accepted on x86-32 and x86-64

The difference to the status quo is that:
- We stop accepting stdcall, fastcall on targets that are windows && non-x86-32 (we already don't accept these on targets that are non-windows && non-x86-32)
- We stop accepting cdecl on targets that are non-x86-32
- (There is no difference for thiscall, this was already a hard error on non-x86-32)
- We stop accepting vectorcall on targets that are windows && non-x86-*

Vectorcall is an unstable ABI so we can just make this a hard error immediately. The others are stable, so we emit the `unsupported_calling_conventions` forward-compat lint. I set up the lint to show up in dependencies via cargo's future-compat report immediately, but we could also make it show up just for the local crate first if that is preferred.

try-job: i686-msvc-1
try-job: x86_64-msvc-1
try-job: test-various
2025-06-09 05:21:49 +00:00
bors
05bc59e251 Auto merge of #142008 - RalfJung:const-eval-error-here, r=oli-obk
const-eval error: always say in which item the error occurred

I don't see why "is this generic" should make a difference. It may be reasonable to key this on whether the error occurs in a `const fn` that was invoked by a const (making it non-obvious which constant it is) vs inside the body of the const.

r? `@oli-obk`
2025-06-08 23:18:34 +00:00
Chayim Refael Friedman
9fc1b9076c
Merge pull request #19949 from ChayimFriedman2/stabilize-json
fix: Stabilize the "JSON is not Rust" diagnostic
2025-06-09
2025-06-08 21:46:16 +00:00
Chayim Refael Friedman
14cb64c9d9 Stabilize the "JSON is not Rust" diagnostic 2025-06-09 00:35:40 +03:00
bors
0962555828 Auto merge of #141700 - RalfJung:atomic-intrinsics-part2, r=bjorn3
Atomic intrinsics : use const generic ordering, part 2

This completes what got started in https://github.com/rust-lang/rust/pull/141507 by using a const generic for the ordering for all intrinsics. It is based on that PR; only the last commit is new.

Blocked on:
- https://github.com/rust-lang/rust/pull/141507
- https://github.com/rust-lang/rust/pull/141687
- https://github.com/rust-lang/stdarch/pull/1811
- https://github.com/rust-lang/rust/pull/141964

r? `@bjorn3`
2025-06-08 20:17:28 +00:00
bors
2322ce4fd0 Auto merge of #142095 - joshtriplett:optimize-veccache, r=SparrowLii
Simplify and optimize `VecCache`'s `SlotIndex::from_index`

Simplify and optimize `SlotIndex::from_index`

Break out bucket 0 (containing `idx < 4096`) as an early return, which
simplifies the remainder of the function, and allows optimizing the
`checked_ilog2` since it can no longer return `None`.

This reduces the runtime of `vec_cache::tests::slot_index_exhaustive`
(which calls `SlotIndex::from_index` for every `u32`, twice) from ~15.5s
to ~13.3s.

Separately, simplify the test case as well. (The old and new code passes with
the old and new test case.)

---

Noticed because `slot_index_exhaustive` stood out as taking unusually long compared to other tests, so I started investigating what it was doing.
2025-06-08 15:26:49 +00:00
Chayim Refael Friedman
ba6f6e2e34 Add the quickfix for increasing visibility of a private field to the private-field diagnostic (previously it was only on no-such-field)
The difference between the diagnostics is that no-such-field is for record struct construction, while private-field is for dot syntax.

I tried to unify them, but there is a bit of uniqueness in each. This is possible but maybe not worth it.

Also, fix the quickfix when there is already a visibility to the field (replace it instead of appending to it).
2025-06-08 15:17:34 +03:00
bors
f3d67558d7 Auto merge of #142088 - compiler-errors:perf-universal-stall, r=lcnr
Filter out universals and lifetimes from `stalled_vars`

lol

r? lcnr
2025-06-08 11:25:24 +00:00
Ralf Jung
ef2caa0bf7
Merge pull request #4385 from rust-lang/rustup-2025-06-08
Automatic Rustup
2025-06-08 05:41:23 +00:00
bors
9a805525bf Auto merge of #142085 - compiler-errors:perf-self-obl, r=lcnr
Don't walk into `Certainty::Yes` goals

Don't walk into `Certainty::Yes` goals in the pending obligation finding code, since they will not have been stalled on an infer var anyways
2025-06-08 05:30:59 +00:00
The Miri Cronjob Bot
03532d1ce7 Merge from rustc 2025-06-08 05:03:35 +00:00
bors
ff596225ec Auto merge of #142074 - oli-obk:its-finally-gone, r=petrochenkov
Remove CollectItemTypesVisitor

I always felt like we were very unnecessarily walking the HIR, let's see if perf agrees

There is lots to ~~improve~~ consolidate further here, as we still have 3 item wfchecks:

* check_item (matching on the hir::ItemKind)
    * actually doing trait solver based checks (by using HIR spans)
* lower_item (matching on the hir::ItemKind after loading it again??)
    * just ensure_ok-ing a bunch of queries
* check_item_type (matching on DefKind)
    * some type based checks, mostly ensure_ok-ing a bunch of queries

fixes rust-lang/rust#121429
2025-06-08 02:04:41 +00:00
bors
753ad2add3 Auto merge of #142181 - GuillaumeGomez:rollup-pn2p1lu, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#140560 (Allow `#![doc(test(attr(..)))]` everywhere)
 - rust-lang/rust#141447 (Document representation of `Option<unsafe fn()>`)
 - rust-lang/rust#141661 (Make the `dangerous_implicit_autorefs` lint deny-by-default)
 - rust-lang/rust#142065 (Stabilize `const_eq_ignore_ascii_case`)
 - rust-lang/rust#142116 (Fix bootstrap tracing imports)
 - rust-lang/rust#142126 (Treat normalizing consts like normalizing types in deeply normalize)
 - rust-lang/rust#142140 (compiler: Sort and doc ExternAbi variants)
 - rust-lang/rust#142148 (compiler: Treat ForceWarning as a Warning for diagnostic level)
 - rust-lang/rust#142154 (get rid of spurious cfg(bootstrap))

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-07 23:05:07 +00:00
Chayim Refael Friedman
7b64b407e8 Correctly handle attr macros placed in cfg_attr in speculative expansion 2025-06-08 01:44:14 +03:00
Chayim Refael Friedman
cc50868148 Remove the optimization of builtin attrs in is_inside_macro_call()
`#[cfg_attr]` is a builtin attr, but it may still contain a macro.
2025-06-08 01:07:55 +03:00
Guillaume Gomez
299104e52e
Rollup merge of #142154 - RalfJung:no-more-cfg-bootstrap, r=oli-obk
get rid of spurious cfg(bootstrap)

r? ```@oli-obk```
2025-06-07 22:23:00 +02:00
Guillaume Gomez
99abdfc0d4
Rollup merge of #142148 - workingjubilee:dont-ice-on-force-warn, r=Urgau
compiler: Treat ForceWarning as a Warning for diagnostic level

This silences an ICE.

No idea if this is the correct solution though tbh.

Fixes rust-lang/rust#142144
2025-06-07 22:22:59 +02:00
Guillaume Gomez
c1ca2c1a0a
Rollup merge of #142140 - workingjubilee:sort-extern-abi-variants, r=bjorn3
compiler: Sort and doc ExternAbi variants

My personal brainworms found this ordering made the most sense while writing the CanonAbi PR.  It is *an* ordering, at least, unlike the current mess. There has been no particular reason for the previous order ever since rust-lang/rust#136901, despite the comment I delete here. I just didn't change it.

Because I feel weird just fussing with variant ordering in the source definition, I also documented a bunch to the best of my ability.
2025-06-07 22:22:59 +02:00
Guillaume Gomez
081d65dc6d
Rollup merge of #142126 - compiler-errors:normalize-uv-via-relate, r=BoxyUwU
Treat normalizing consts like normalizing types in deeply normalize

...so that we don't end up putting a top-level normalizes-to goal in the fulfillment context, which ICEs. This basically just models the normalize-const code off of the normalize-ty code above it, which uses an alias-relate goal instead.

Fixes rust-lang/rust#140571

r? lcnr
2025-06-07 22:22:58 +02:00
Guillaume Gomez
d021de4a9a
Rollup merge of #142116 - jieyouxu:fix-tracing, r=Mark-Simulacrum
Fix bootstrap tracing imports
2025-06-07 22:22:58 +02:00
Guillaume Gomez
42c62678fe
Rollup merge of #142065 - paolobarbolini:stabilize-const_eq_ignore_ascii_case, r=Mark-Simulacrum
Stabilize `const_eq_ignore_ascii_case`

Tracking issue: rust-lang/rust#131719
Closes rust-lang/rust#131719
FCP Completed: https://github.com/rust-lang/rust/issues/131719#issuecomment-2941829167
2025-06-07 22:22:57 +02:00
Guillaume Gomez
bfdb96ea07
Rollup merge of #141661 - Urgau:deny-dangerous_implicit_autorefs, r=traviscross
Make the `dangerous_implicit_autorefs` lint deny-by-default

I intended for the `dangerous_implicit_autorefs` lint to be deny-by-default, the [T-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097) even clearly mentioned deny-by-default, but somehow I and other missed that it is only warn-by-default.

I think the lint should still be deny-by-default as the implicit aliasing requirements can be quite dangerous.

In any-case, opening this PR for T-lang awareness.

`@rustbot` label +I-lang-nominated +T-lang
r? `@traviscross`
2025-06-07 22:22:57 +02:00
Guillaume Gomez
8a4b23968d
Rollup merge of #141447 - y86-dev:option-layout-docs, r=RalfJung
Document representation of `Option<unsafe fn()>`

https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Option.20Layout.20with.20.60fn.60.20pointers/with/520055652
2025-06-07 22:22:56 +02:00
Guillaume Gomez
7c8ac0f4ef
Rollup merge of #140560 - Urgau:test_attr-module-level, r=GuillaumeGomez
Allow `#![doc(test(attr(..)))]` everywhere

This PR adds the ability to specify [`#![doc(test(attr(..)))]`](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/the-doc-attribute.html#testattr) ~~at module level~~ everywhere in addition to allowing it at crate-root.

This is motivated by a recent PR #140323 (by ````@tgross35)```` where we have to duplicate 2 attributes to every single `f16` and `f128` doctests, by allowing `#![doc(test(attr(..)))]` at module level (and everywhere else) we can omit them entirely and just have (in both module):

```rust
#![doc(test(attr(feature(cfg_target_has_reliable_f16_f128))))]
#![doc(test(attr(expect(internal_features))))]
```

Those new attributes are appended to the one found at crate-root or at a previous module. Those "global" attributes are compatible with merged doctests (they already were before).

Given the small addition that this is, I'm proposing to insta-stabilize it, but I can feature-gate it if preferred.

Best reviewed commit by commit.

r? ````@GuillaumeGomez````
2025-06-07 22:22:55 +02:00
bors
4e1623e1ad Auto merge of #141950 - oli-obk:big-body-owner-loop, r=compiler-errors
Move coroutine_by_move_body_def_id into the big check_crate body owner loop

This avoids starting a parallel loop in sequence and instead runs all the queries for a specific DefId together.
2025-06-07 20:06:23 +00:00
bors
f7014ef76c Auto merge of #141964 - sayantn:update-stdarch, r=Amanieu
Update stdarch submodule

Updates the stdarch submodule.

## Merged PRs

 - rust-lang/stdarch#1797
 - rust-lang/stdarch#1758
 - rust-lang/stdarch#1798
 - rust-lang/stdarch#1811
 - rust-lang/stdarch#1810
 - rust-lang/stdarch#1807
 - rust-lang/stdarch#1806
 - rust-lang/stdarch#1812
 - rust-lang/stdarch#1795
 - rust-lang/stdarch#1796
 - rust-lang/stdarch#1813
 - rust-lang/stdarch#1816
 - rust-lang/stdarch#1818
 - rust-lang/stdarch#1820
 - rust-lang/stdarch#1819

r? `@Amanieu`
`@rustbot` label T-libs-api

Closes rust-lang/rust#111137
2025-06-07 12:25:59 +00:00
bors
4567c6063e Auto merge of #141917 - petrochenkov:nobinroot, r=jieyouxu
bootstrap: Remove `rustc_snapshot_libdir` from PATH in one more place

Same as https://github.com/rust-lang/rust/pull/141657 but in a different part of the build system, with the same goal of addressing [#t-infra/bootstrap > Build broken in MSYS2 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Build.20broken.20in.20MSYS2/near/520709527).

It seems to work on windows-{gnu,msvc} and linux-gnu at least.

r? jieyouxu
2025-06-07 09:21:38 +00:00
bors
2965c2bac3 Auto merge of #141910 - Kobzol:new-bors-try-branch-name-doc, r=marcoieni
Fix `create-docs-artifacts.sh` with new bors

The slashes in the branch name (`automation/bors/try`) were causing issues for this script (https://github.com/rust-lang/rust/actions/runs/15391908130/job/43303193243).

r? `@marcoieni`

try-job: `mingw-check*`
2025-06-07 03:21:09 +00:00
bors
dbe094cca6 Auto merge of #141800 - workingjubilee:build-std-with-less-leaf-pointers, r=saethlin
bootstrap: build std sans leaf frame pointers

Sometimes leaf frame-pointers can impact LLVM inlining choices, and that can be a real problem for things like `mul_add`.
2025-06-06 21:21:59 +00:00
bors
4ed388a832 Auto merge of #141774 - oli-obk:naked-fn-queries, r=petrochenkov
Change per-module naked fn checks to happen during typeck instead

cc `@Lokathor` `@Amanieu` `@folkertdev`

just seems nicer this way
2025-06-06 18:22:10 +00:00
bors
e47eed0cd3 Auto merge of #141681 - compiler-errors:fast-path-stalled, r=lcnr
Fast path for stalled obligations on self ty

If we see that the `self` type of a goal is an infer var, then don't try to compute the goal at all, since we know that it'll be forced ambiguous.

This is currently only implemented when there are no opaques in the environment. We could extend it to check that the self type is not related to any already defined opaques via subtyping, but I'll leave that as a follow-up.

---

Also stall coerce and subtype predicates if both of their vars are not resolved to concrete types.

---

~~Also, we don't care if the goal is higher-ranked for the sized and copy/clone fast path.~~ pulling this out into another PR.

r? lcnr
2025-06-06 15:20:21 +00:00
Chayim Refael Friedman
25a7b2480e In "Fill match arms", allow users to prefer Self to the enum name when possible
But default to not to.

I chose to have a more generic config name because maybe other assists could also use the same approach.
2025-06-06 16:34:53 +03:00
Vincent Esche
1a3feeebc4 Make Semantics<'db, dyn HirDatabase> actually usable 2025-06-06 09:45:34 +02:00
Lukas Wirth
6acff6c1f8
Merge pull request #19908 from rmehri01/rmehri01/diagnostic_attribute_completions
feat: implement attribute completions for diagnostics module
2025-06-06 07:19:13 +00:00
Lukas Wirth
4fd1cdb3e3
Merge pull request #19937 from Veykril/push-rvnylnlnxxyr
fix: Record macro calls for fields in `ChildBySource` impls
2025-06-06 05:45:48 +00:00
Lukas Wirth
cad9cc97e2
Merge pull request #19935 from ChayimFriedman2/exp-diag-show-quickfix
fix: Always include quickfixes for diagnostics, even when diagnostics are disabled
2025-06-06 05:35:52 +00:00
Lukas Wirth
1436449e12
Merge pull request #19936 from ChayimFriedman2/unlinked-file-stable
fix: Stabilize unlinked file diagnostic
2025-06-06 05:35:02 +00:00