Commit graph

313173 commits

Author SHA1 Message Date
Redddy
164eec7f93 Add rust-analyzer book link to the guide 2025-12-14 22:24:11 +02:00
Tshepang Mbambo
c9301df0d7
Merge pull request #2692 from rust-lang/tshepang/fuzzing
small improvements to fuzzing.md
2025-12-13 18:27:48 +02:00
Tshepang Mbambo
cc8cfcc187 fails link checks
error: Potential incomplete link
     ┌─ fuzzing.md:41:122
     │
  41 │ > error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead
     │                                                                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Did you forget to define a URL for `closure@src/main.rs:36:25: 36:28`?
2025-12-13 18:26:45 +02:00
Tshepang Mbambo
da01b354cf redundant 2025-12-13 18:22:07 +02:00
Tshepang Mbambo
86f18b3f84 use compact format, as this is what is in bootstrap.example.toml 2025-12-13 18:22:07 +02:00
Tshepang Mbambo
cc28befef1 fluff 2025-12-13 18:22:07 +02:00
Tshepang Mbambo
d8d8dbd973 feels appropriate 2025-12-13 18:22:07 +02:00
Tshepang Mbambo
6f5454a580 guidance is clear enough 2025-12-13 18:22:07 +02:00
Tshepang Mbambo
d79d0aef3c horizontal scroll is excessive for these examples 2025-12-13 18:22:07 +02:00
Tshepang Mbambo
a1b57f4383 remove unclear text 2025-12-13 17:39:16 +02:00
Tshepang Mbambo
cfe2be49b5 make more readable 2025-12-13 17:36:27 +02:00
Tshepang Mbambo
e513e48230
Merge pull request #2691 from rust-lang/tshepang/sembr
sembr fuzzing.md
2025-12-13 17:30:23 +02:00
Tshepang Mbambo
3d73b32634 sembr fuzzing.md 2025-12-13 17:27:53 +02:00
Tshepang Mbambo
9d62f73e87 fix corner case 2025-12-13 17:27:31 +02:00
Tshepang Mbambo
ce0f8c9b4d test is hard to follow 2025-12-13 16:43:13 +02:00
Tshepang Mbambo
745a0fb8d3 does not work for some reason 2025-12-13 16:24:32 +02:00
Tshepang Mbambo
dd91e00381 whitespace 2025-12-13 16:19:08 +02:00
Tshepang Mbambo
06ba83ebf3
Merge pull request #2690 from rust-lang/tshepang/sembr
sembr readme
2025-12-13 16:10:19 +02:00
Tshepang Mbambo
bf1f3ebf37 point to the "main crate", instead of a list of crates 2025-12-13 16:08:32 +02:00
Tshepang Mbambo
8a781505a3
Merge pull request #2689 from rust-lang/rustc-pull
Rustc pull update
2025-12-13 16:03:39 +02:00
Tshepang Mbambo
48782ebaea small README improvements 2025-12-13 15:56:22 +02:00
Tshepang Mbambo
ef04de5f20 sembr nit (missed by tool) 2025-12-13 15:54:54 +02:00
The rustc-josh-sync Cronjob Bot
cf9c20b7a5 Merge ref 'ce63e5d9ea' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: ce63e5d9ea
Filtered ref: 3be97edf085b31c6544c8afec49edf22b7f04c2f
Upstream diff: dfe1b8c97b...ce63e5d9ea

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-13 13:33:29 +00:00
The rustc-josh-sync Cronjob Bot
12c2c05a26 Prepare for merging from rust-lang/rust
This updates the rust-version file to ce63e5d9ea.
2025-12-13 13:27:26 +00:00
Tshepang Mbambo
42334f76a7 sembr README.md 2025-12-13 15:22:27 +02:00
Zalathar
bc11e7e142 Rename match-candidate partitioning methods 2025-12-13 21:15:22 +11:00
Zalathar
d602710e5a Move match-candidate partitioning code into its own module 2025-12-13 21:15:22 +11:00
bors
ce63e5d9ea Auto merge of #149941 - jhpratt:rollup-9p1xc2t, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145278 (Update `rustc_codegen_gcc` rotate operation document)
 - rust-lang/rust#148837 (Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`)
 - rust-lang/rust#149177 (Add proper suggestion for associated function with unknown field)
 - rust-lang/rust#149843 (Inherit attributes in delegation)
 - rust-lang/rust#149860 (Fix: Prevent macro-expanded extern crates from shadowing extern arguments)
 - rust-lang/rust#149874 (Weak for Arc pointer is marked as DynSend/DynSync)
 - rust-lang/rust#149903 (Remove unused code in `cfg_old`)
 - rust-lang/rust#149911 (bootstrap: Don't pass an unused `--color` to compiletest)
 - rust-lang/rust#149916 (Add a sanity check in case of any duplicate nodes)
 - rust-lang/rust#149924 (`declare_lint_pass` for `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-13 07:00:41 +00:00
Jacob Pratt
3eba6b1fb9
Rollup merge of #149924 - JamieCunliffe:inline-lint-unknown, r=davidtwco
`declare_lint_pass` for `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES`

The `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES` lint was missing from this causing it to be an unknown lint when attempting to allow it.

r? ``@davidtwco``
2025-12-13 00:55:59 -05:00
Jacob Pratt
754b4a4945
Rollup merge of #149916 - zetanumbers:double_node_sanity, r=petrochenkov
Add a sanity check in case of any duplicate nodes

A simple check in case compiler tries to encode a dep node twice like in rust-lang/rust#141540.

Also if we'd try to mark a red node as green as it may then create a bad `DepNodeIndex` like in rust-lang/rust#148295.

If it prevents rust-lang/rust#141540 from emitting a faulty `dep-graph.bin` file via panic then it means you will be able to temporarily fix it by simply restarting cargo or rust-analyzer without cleaning up incremental cache.
2025-12-13 00:55:59 -05:00
Jacob Pratt
aec47812cf
Rollup merge of #149911 - Zalathar:no-color, r=jieyouxu
bootstrap: Don't pass an unused `--color` to compiletest

- Follow-up to https://github.com/rust-lang/rust/pull/149850

---

This flag was an artifact of compiletest's old libtest-based test executor, and currently doesn't influence compiletest's output at all.

A follow-up commit also inlines `force_coloring_in_ci` into its only remaining caller, and updates its comment.
2025-12-13 00:55:58 -05:00
Jacob Pratt
6b29f18654
Rollup merge of #149903 - JonathanBrouwer:cfg_old_cleanup, r=jdonszelmann
Remove unused code in `cfg_old`

r? ```@jdonszelmann```

Fixes one of the todos from https://github.com/rust-lang/rust/issues/149865
2025-12-13 00:55:58 -05:00
Jacob Pratt
bcde603308
Rollup merge of #149874 - azhogin:azhogin/arc_weak_dyn_send_sync, r=eholk
Weak for Arc pointer is marked as DynSend/DynSync

`std::sync::Weak` (weak pointer for Arc) added to DynSend and DynSync (looks like it was missed to add there when implemented).
2025-12-13 00:55:57 -05:00
Jacob Pratt
47f1502c73
Rollup merge of #149860 - Delta17920:fix/149821-root-cause, r=petrochenkov
Fix: Prevent macro-expanded extern crates from shadowing extern arguments

prevents an ICE by fixing a logic bug in `build_reduced_graph.rs`.
the bug caused the compiler to correctly detect and report a shadowing error for a macro-expanded `extern crate` but then continue processing the invalid item, corrupting the resolver's internal state (`extern_prelude`) and leading to a crash in later resolution passes the fix adds an early return after the shadowing error is reported to ensure the invalid item is not added to the resolution graph.

Fixes rust-lang/rust#149821
2025-12-13 00:55:56 -05:00
Jacob Pratt
e7ba4a5e6d
Rollup merge of #149843 - aerooneqq:inherit-attributes-in-delegation, r=petrochenkov
Inherit attributes in delegation

This PR adds support for inheriting attributes of the original function of the delegation and is a part of rust-lang/rust#118212, for now we inherit only #[must_use] attribute, but we can add other attributes to inherit. The list of processed attributes can be found [here](https://github.com/aerooneqq/public-docs/blob/master/rust/delegation/processed_attributes.md).

r? ``@petrochenkov``
2025-12-13 00:55:56 -05:00
Jacob Pratt
d175f11e0e
Rollup merge of #149177 - chenyukang:yukang-fix-assoc-func-149038, r=estebank
Add proper suggestion for associated function with unknown field

Fixes rust-lang/rust#149038

The first commit is changing the old suggestion to verbose,
the second commit is a new added suggestion.

r? ``@estebank``
2025-12-13 00:55:55 -05:00
Jacob Pratt
b32845c61a
Rollup merge of #148837 - estebank:let-else, r=Kivooeo
Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`
2025-12-13 00:55:55 -05:00
Jacob Pratt
397339e928
Rollup merge of #145278 - notJoon:doc/rotate-operation, r=antoyo
Update `rustc_codegen_gcc` rotate operation document

## Description

This PR resolves a TODO comment in the `rustc_codegen_gcc` backend by documenting that the rotate operations (`rotate_left` and `rotate_right`) already implement the optimized branchless algorithm from comment.

The existing implementation already uses the optimal branchless rotation pattern:
- For left rotation: `(x << n) | (x >> (-n & (width-1)))`
- For right rotation: `(x >> n) | (x << (-n & (width-1)))`

This pattern avoids branches and generates efficient machine code across different platforms, which was the goal mentioned in the original TODO.

## Changes

- Removed the TODO comment that suggested implementing the algorithm from https://blog.regehr.org/archives/1063
2025-12-13 00:55:54 -05:00
Boxy
9f4a972c52
Merge pull request #2688 from cyrgani/errorcode
update some outdated infos on error codes
2025-12-13 00:53:45 +00:00
bors
dc47a69ed9 Auto merge of #149136 - BoxyUwU:mgca_explicit_anon_consts, r=oli-obk
MGCA: Syntactically distinguish anon const const args

r? oli-obk

tracking issue: rust-lang/rust#132980

This PR requires that when `feature(min_generic_const_args)` is enabled, anon const const args are *syntactically* distinguishable from other kinds of args. We use `const { ... }` in const argument position to denote an anon const:
```rust
#![feature(min_generic_const_args)]

// no longer allowed as `1 + 1` is represented via an anon const and
// there is no syntactic marker
type Foo = [(); 1 + 1];

// allowed, `const { ... }` indicates an anon const representation
type Foo = [(); const { 1 + 1 }];
```

This restriction is only placed when mgca is enabled. There should be no effect on stable. This restriction is not enforced for unbraced literals which we continue to implicitly wrap in an anon const: `tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs`

This restriction allows us to create `DefId`s for anon consts only when actually required. When it is syntactically ambiguous whether a const argument is an anon const or not we are forced to conservatively create a `DefId` for every const argument even if it doesn't wind up needing one.

This works fine on stable but under `mgca` we can wind up with anon consts nested inside non-anon-const const arguments resulting in a broken `DefId` tree. See rust-lang/rust#148838 where an anon const arg inside of a path arg winds up with a parent of a conservatively created `DefId` that doesn't actually correspond to an anon const, resulting in an ICE.

With rust-lang/rust#149114 every field initialiser in a const argument would become a place where there could *possibly* be an anon const. This would also get worse once we support tuple constructors- now every function argument is a place where there could possibly be an anon const.

We introduce this restriction to avoid creating massive amounts of unused `DefId`s that make the parent tree significantly more complicated, and to avoid having to paper over this issue in things like `generics_of`.

Fixes rust-lang/rust#148838

It also must be syntactically clear from context whether `'_` means an inference lifetime or an elided lifetime parameter. This restriction will allow us to properly resolve `'_` in const arguments in mgca. This PR doesn't actually fix handle this, but we could do so trivially after this lands.
2025-12-12 21:35:31 +00:00
cyrgani
900c79ac89 update some outdated infos on error codes 2025-12-12 21:27:18 +00:00
bors
fa5eda19b9 Auto merge of #149917 - GuillaumeGomez:malformed-attribute-suggestions, r=JonathanBrouwer
If there are too many suggestions for malformed attribute, do not suggest them

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

This not only covers for doc attributes but for all attributes, so don't hesitate to tell me if you want it to be limited to only doc attributes (although I think it's actually a nice improvement overall).

Also, I picked 3 as the maximum number of suggestions before it becomes noise, but it's very much open to debate.

r? `@JonathanBrouwer`
2025-12-12 18:18:14 +00:00
Esteban Küber
97c7742151 revert one change from rustc_next_trait_solver 2025-12-12 17:55:26 +00:00
Esteban Küber
a49c175380 #![deny(clippy::manual_let_else)] in some rustc modules 2025-12-12 17:53:19 +00:00
Esteban Küber
146711fc24 Use let...else instead of match foo { ... _ => return }; and if let ... else return 2025-12-12 17:52:39 +00:00
Boxy
f936b9f5c4
Refinement of Providers into Providers and ExternProviders 2025-12-12 17:45:22 +00:00
aerooneqq
0a3fd24287 Support attribute inheritance in delegation 2025-12-12 20:34:54 +03:00
xizheyin
49db9ec01b Update and add more details for Providers
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>

Co-authored-by: Boxy <rust@boxyuwu.dev>
2025-12-13 00:47:25 +08:00
delta17920
0748492e2b Fix: Prevent macro-expanded extern crates from shadowing extern arguments 2025-12-12 16:22:25 +00:00
Boxy Uwu
acc3a0e2da Syntactically distinguish anon const const args 2025-12-12 15:45:37 +00:00