Commit graph

311631 commits

Author SHA1 Message Date
Kornel
3faad7cc41
Suggest _bytes versions of endian-converting methods 2025-11-25 00:57:50 +00:00
bors
c871d09d1c Auto merge of #149276 - matthiaskrgr:rollup-wlrpdrr, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#148234 (rustdoc: make mergeable crate info more usable)
 - rust-lang/rust#149201 (Add suggest alternatives for Out-of-range \x escapes)
 - rust-lang/rust#149208 ([rustdoc] Make more functions return `fmt::Result` and reduce number of `.unwrap()` calls)
 - rust-lang/rust#149252 (miri: use `tikv-jemalloc-sys` from sysroot)
 - rust-lang/rust#149255 (Use `let...else` consistently in user-facing diagnostics)
 - rust-lang/rust#149275 (Fix missing double-quote in `std::env::consts::OS` values)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-24 20:22:07 +00:00
Matthias Krüger
5ec55d3afd
Rollup merge of #149275 - KeyWeeUsr:fix-solid-os-typo, r=bjorn3
Fix missing double-quote in `std::env::consts::OS` values

Noticed this one while reading the docs. Hopefully it's not too small change.
2025-11-24 19:10:47 +01:00
Matthias Krüger
738e87282e
Rollup merge of #149255 - reddevilmidzy:let-else, r=Kivooeo
Use `let...else` consistently in user-facing diagnostics

resolve: rust-lang/rust#148772

Standardize `let...else` terminology in user-facing diagnostics.

Goal: Consistently use `let...else` in all error/warning messages.

Internal technical names (`let-else`) in comments and documentation remain unchanged.

cc ``@carols10cents,`` ``@jieyouxu``
2025-11-24 19:10:46 +01:00
Matthias Krüger
b9fdf6a0d8
Rollup merge of #149252 - madsmtm:miri-jemalloc, r=RalfJung
miri: use `tikv-jemalloc-sys` from sysroot

This allows LTO to work when compiling jemalloc (which is currently broken due to https://github.com/rust-lang/cc-rs/issues/1613), which should yield a small performance boost, and makes Miri's behaviour here match Clippy
and Rustdoc.

Follow-up to https://github.com/rust-lang/rust/pull/148925 / https://github.com/rust-lang/rust/pull/146627 after discussion in https://github.com/rust-lang/rust/pull/148925#pullrequestreview-3465393783.

r? RalfJung
2025-11-24 19:10:45 +01:00
Matthias Krüger
a68aff6a53
Rollup merge of #149208 - GuillaumeGomez:less-unwraps, r=yotamofek,lolbinarycat
[rustdoc] Make more functions return `fmt::Result` and reduce number of `.unwrap()` calls

Following our discussion in https://github.com/rust-lang/rust/pull/149028#discussion_r2550675531, this PR makes more function return `fmt::Result`, allowing to use `?` a lot more, and also reducing number of `.unwrap()` calls.

r? `@lolbinarycat`
2025-11-24 19:10:44 +01:00
Matthias Krüger
ade1581dc7
Rollup merge of #149201 - chenyukang:fix-str-format, r=Kivooeo
Add suggest alternatives for Out-of-range \x escapes

Fixes rust-lang/rust#148917

seems add two notes seems better.

r? `@scottmcm`
2025-11-24 19:10:44 +01:00
Matthias Krüger
be49e00109
Rollup merge of #148234 - notriddle:doc-cci, r=GuillaumeGomez
rustdoc: make mergeable crate info more usable

Part of https://github.com/rust-lang/rust/issues/130676

Adds documentation and a feature change aimed at making this usable without breaking backwards compat.

cc ``@EtomicBomb``
2025-11-24 19:10:43 +01:00
bors
b64df9d101 Auto merge of #149265 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to cf4b1faea3.

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

r? `@ghost`
2025-11-24 17:08:47 +00:00
Peter Badida
6173a56716
Fix missing double-quote in std::env::consts::OS values 2025-11-24 18:02:24 +01:00
yukang
4d4f3151fb Add suggest alternatives for Out-of-range \x escapes 2025-11-24 19:36:20 +08:00
Laurențiu Nicola
87e4974fa8 Reformat python script 2025-11-24 13:07:39 +02:00
Guillaume Gomez
c524ed710d Make more functions return fmt::Result and reduce number of .unwrap() calls 2025-11-24 11:41:03 +01:00
bors
42ec52baba Auto merge of #149258 - reddevilmidzy:ice, r=Kivooeo
Fix None handling for simplify_type in for_each_relevant_impl

resolve: rust-lang/rust#148062
2025-11-24 09:44:26 +00:00
Lukas Wirth
59dafb3896
Merge pull request #21097 from Veykril/push-zpqupukpkrts
proc-macro-srv: Reimplement token trees via immutable trees
2025-11-24 09:09:16 +00:00
Mads Marquart
522e47fd60 miri: use tikv-jemalloc-sys from sysroot
This allows LTO to work when compiling jemalloc, which should yield a
small performance boost, and makes miri's behaviour here match clippy
and rustdoc.
2025-11-24 10:00:23 +01:00
Lukas Wirth
bb89b62ed5 Couple more tests 2025-11-24 09:59:07 +01:00
Chayim Refael Friedman
320c881baa
Merge pull request #21116 from xdBronch/push-okwnouotntqt
add deprecated semantic token for extern crate shorthand
2025-11-24 07:51:21 +00:00
reddevilmidzy
eb72e6764e Fix None handling for simplify_type in for_each_relevant_impl 2025-11-24 16:06:15 +09:00
bors
69408a877e Auto merge of #147760 - Walnut356:gnu_enum_viz, r=Mark-Simulacrum,saethlin
[Debugger Visualizers] Unify `*-gnu` and `*-msvc` enum output

Followup patch to rust-lang/rust#145218

Ports the msvc enum synthetic/summary logic to the gnu handlers so they have identical output. Also removes the "look-through-pointers" logic that caused rust-lang/rust#147450

<img width="629" height="220" alt="image" src="https://github.com/user-attachments/assets/d6ae44d5-232f-412d-b291-64ac52850c74" />

I know we don't run the test suite in CI anymore, but it's still useful locally so I updated the relevant tests.
2025-11-24 06:30:24 +00:00
Walnut
af1c2b277d update tests 2025-11-24 00:17:53 -06:00
Shoyu Vanilla (Flint)
0289ce4c65
Merge pull request #20937 from A4-Tacks/duplicate-raw-const
Fix duplicate `const` complete after `raw`
2025-11-24 05:53:56 +00:00
reddevilmidzy
d3e4dd29a8 Use let...else consistently in user-facing diagnostics 2025-11-24 11:41:52 +09:00
A4-Tacks
aecab3493b
Fix duplicate const complete after raw
Example
---
```rust
fn main() { let _ = &raw $0 }
```

**Before this PR**

```text
fn main() fn()
bt u32     u32
kw const
kw const
kw crate::
...
```

**After this PR**

```text
fn main() fn()
bt u32     u32
kw const
kw crate::
...
```
2025-11-24 10:18:01 +08:00
Walnut
95b031e7a8 align gnu enum output with msvc enum output 2025-11-23 20:12:08 -06:00
Shoyu Vanilla (Flint)
35ab21b294
Merge pull request #20967 from A4-Tacks/replace-eager-lazy-and-then
Fix not applicable on `and` for replace_method_eager_lazy
2025-11-24 01:49:11 +00:00
Shoyu Vanilla (Flint)
a7d7fa6b4d
Merge pull request #21115 from ChayimFriedman2/upgrade-rustc
internal: Upgrade rustc crates
2025-11-24 01:29:07 +00:00
bors
d3e1ccdf40 Auto merge of #149247 - jhpratt:rollup-mq8f5wo, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#149179 (Add regression test for 128705)
 - rust-lang/rust#149197 (validate usage of crate-level doc attributes)
 - rust-lang/rust#149232 (Add doc aliases "vector" and "list" to `Vec`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-23 23:47:00 +00:00
Jacob Pratt
b758cbda3e
Rollup merge of #149232 - madsmtm:vec-doc-aliases, r=Noratrieb
Add doc aliases "vector" and "list" to `Vec`

- "vector" is what "vec" is short form for.
- "list" is a common name for this concept in a lot of other languages (`ArrayList` in Java, `list` in Python, `List` in C#). C++ uses the term for a linked list (`std::list`), so maybe this is contentious?

I believe that this falls under [the doc alias policy](https://std-dev-guide.rust-lang.org/policy/doc-alias.html), and I think it's plausible that a newcomer would search for either of these terms, and expect to find `Vec`.

r? libs
2025-11-23 16:28:14 -05:00
Jacob Pratt
fdcf1f2d80
Rollup merge of #149197 - lolbinarycat:rustdoc-bad-render-attr, r=GuillaumeGomez
validate usage of crate-level doc attributes

fixes https://github.com/rust-lang/rust/issues/149187

r? `@GuillaumeGomez`
2025-11-23 16:28:13 -05:00
Jacob Pratt
2b3b95b54e
Rollup merge of #149179 - reddevilmidzy:test, r=JonathanBrouwer
Add regression test for 128705

close: rust-lang/rust#128705
2025-11-23 16:28:12 -05:00
bors
c23ed3ef28 Auto merge of #148925 - madsmtm:jemalloc-perf, r=Kobzol
Simplify `jemalloc` setup (without perf regression)

Reland https://github.com/rust-lang/rust/pull/146627 after fixing [the performance regression](https://github.com/rust-lang/rust/pull/148851#issuecomment-3525797560) that caused it to be reverted in https://github.com/rust-lang/rust/pull/148896.

This avoids 65f0b7a (second commit in the initial PR), and adds a comment explaining why `extern crate` is needed here instead of `use` (we need to load `tikv_jemalloc_sys` from the sysroot because of https://github.com/rust-lang/cc-rs/issues/1613).

r? Kobzol
2025-11-23 20:34:07 +00:00
xdBronch
834ee5f0e5 add deprecated semantic token for extern crate shorthand 2025-11-23 14:24:24 -05:00
Lukas Wirth
072aaa0b5a
Merge pull request #21098 from Aditya-PS-05/fix/include-bin-targets-outside-pkg-root
fix: include all target types with paths outside package root
2025-11-23 18:02:36 +00:00
binarycat
2ee6196078 validate usage of crate-level doc attributes 2025-11-23 12:00:53 -06:00
bors
e9acbd99d3 Auto merge of #147827 - saethlin:maybeuninit-codegen2, r=scottmcm
Fix MaybeUninit codegen using GVN

This is an alternative to https://github.com/rust-lang/rust/pull/142837, based on https://github.com/rust-lang/rust/pull/146355#discussion_r2421651968.

The general approach I took here is to aggressively propagate anything that is entirely uninitialized. GVN generally takes the approach of only synthesizing small types, but we need to generate large consts to fix the codegen issue.

I also added a special case to MIR dumps for this where now an entirely uninit const is printed as `const <uninit>`, because otherwise we end up with extremely verbose dumps of the new consts.

After GVN though, we still end up with a lot of MIR that looks like this:
```
StorageLive(_1);
_1 = const <uninit>;
_2 = &raw mut _1;
```
Which will break tests/codegen-llvm/maybeuninit-rvo.rs with the naive lowering. I think the ideal fix here is to somehow omit these `_1 = const <uninit>` assignments that come directly after a StorageLive, but I'm not sure how to do that. For now at least, ignoring such assignments (even if they don't come right after a StorageLive) in codegen seems to work.

Note that since GVN is based on synthesizing a `ConstValue`  which has a defined layout, this scenario still gets deoptimized by LLVM.
```rust
#![feature(rustc_attrs)]
#![crate_type = "lib"]
use std::mem::MaybeUninit;

#[unsafe(no_mangle)]
pub fn oof() -> [[MaybeUninit<u8>; 8]; 8] {
    #[rustc_no_mir_inline]
    pub fn inner<T: Copy>() -> [[MaybeUninit<T>; 8]; 8] {
        [[MaybeUninit::uninit(); 8]; 8]
    }

    inner()
}
```
This case can be handled correctly if enough inlining has happened, or it could be handled by post-mono GVN. Synthesizing `UnevaluatedConst` or some other special kind of const seems dubious.
2025-11-23 17:09:07 +00:00
Chayim Refael Friedman
055f39a05e
Merge pull request #21100 from xdBronch/deprecated-tokens
add semantic tokens for deprecated items
2025-11-23 15:24:13 +00:00
Aditya-PS-05
a028fbf641 fix: sort and dedup include paths to prevent VFS issues 2025-11-23 20:45:57 +05:30
xdBronch
03af855e78 add semantic tokens for deprecated items 2025-11-23 09:59:05 -05:00
Chayim Refael Friedman
fe4e93622e Upgrade rustc crates
Major changes:

 - `GoalSource::InstantiateHigherRanked` was removed.
 - `Interner::UnevaluatedConstId` was introduced, allowing further simplifications due to better typing. Generally we don't represent unevaluated consts like we should, but it's still better.
 - `PatternKind::NotNull` was introduced.
2025-11-23 16:23:19 +02:00
Chayim Refael Friedman
7fb94ccad3
Merge pull request #21011 from dfaure-kdab/wip/dfaure/smolstr_pretty_printer
Provide a gdb pretty printer for smol_str::SmolStr
2025-11-23 14:04:07 +00:00
bors
122cbd0438 Auto merge of #147804 - tmiasko:move-copy, r=cjgillot,saethlin
Turn moves into copies after copy propagation

Previously copy propagation presumed that there is further unspecified distinction between move operands and copy operands in assignments and propagated moves from assignments into terminators. This is inconsistent with current operational semantics.

Turn moves into copies after copy propagation to preserve existing behavior.

Fixes https://github.com/rust-lang/rust/issues/137936.
Fixes https://github.com/rust-lang/rust/issues/146423.

r? `@cjgillot`
2025-11-23 13:56:14 +00:00
Chayim Refael Friedman
5dcba5774a
Merge pull request #21114 from lmmx/no-unused-tracing-attributes-feat
fix: no unused `tracing/attributes` feature
2025-11-23 13:51:54 +00:00
David Faure
a87db97854 Provide a gdb pretty printer for smol_str::SmolStr
Auto-loaded via the debugger_visualizer attribute.
Tested on smolstr's unittest:

$ RUSTFLAGS="-C debuginfo=2 -C opt-level=0" cargo test -p smol_str --no-run
$ rust-gdb target/debug/deps/test-a806b111557a7133
(gdb) break test::conversions
(gdb) run
(gdb) next
(gdb) print s
(and other locations in that file, to test the three cases: Inline,
Static and Heap)
2025-11-23 14:49:23 +01:00
Louis Maddox
674a44e120 fix: no unused tracing/attributes feature
- Discussed in https://github.com/rust-lang/rust-analyzer/issues/21107
- Avoids activating an `attributes` feature to crates that do not use it
- Updates the 6 crates that use attributes feature to specify it in
  their Cargo.toml: {hir,hir-def,hir-ty,ide-assists,ide-db,project-model}
2025-11-23 13:37:42 +00:00
Ben Kimock
1a4852c5fe Fix MaybeUninit codegen using GVN 2025-11-23 08:23:49 -05:00
Lukas Wirth
98797f0ce8
Merge pull request #21104 from Veykril/veykril/push-plqyyxsxvtyr
minor: Use `const_eval_static` query for statics
2025-11-23 13:06:52 +00:00
Lukas Wirth
e796bd41f1 Move transitive_rev_deps from db trait away 2025-11-23 13:56:59 +01:00
Lukas Wirth
277dffe9d6 De-querify transitive_deps again 2025-11-23 13:48:53 +01:00
Lukas Wirth
6285836732
Merge pull request #21065 from A4-Tacks/refutable-in-pat-field
Fix always irrefutable in RecordPatField
2025-11-23 12:37:03 +00:00