Commit graph

32939 commits

Author SHA1 Message Date
Lukas Wirth
a0d9dd861d
Merge pull request #18731 from rust-lang/revert-18670-push-ylomnylswnxm
Revert "internal: Drop proc-macro server support for ~1.66.0 and older toolchains"
2024-12-20 20:06:24 +00:00
Lukas Wirth
c966876f85
Revert "internal: Drop proc-macro server support for ~1.66.0 and older toolchains" 2024-12-20 20:51:09 +01:00
Giga Bowser
2b6e7ce896 internal: Standardize how we take iterator parameters in SyntaxFactory 2024-12-20 12:06:27 -05:00
Chayim Refael Friedman
82896b2cc4 Move ty lowering diagnostic definitions into a separate module
To keep them organized.
2024-12-20 15:34:23 +02:00
Lukas Wirth
f4cafbb678
Merge pull request #18729 from Veykril/push-kyxtnozqzwkn
Clear flycheck diagnostics more granularly
2024-12-20 13:23:31 +00:00
Lukas Wirth
db8660410f Clear all check diagnostics when the workspace changes 2024-12-20 14:09:29 +01:00
Lukas Wirth
4a8eb8c229 Arc the package ids coming from flycheck 2024-12-20 14:09:29 +01:00
Lukas Wirth
7da17fe195 Arc the workspace root flycheck 2024-12-20 14:09:11 +01:00
Lukas Wirth
7aab6a5c12 Clear flycheck diagnostics more granularly 2024-12-20 14:09:11 +01:00
Lukas Wirth
15d2d509d0
Merge pull request #18723 from ChayimFriedman2/tracing-complete
fix: Fix a case where completion was unable to expand a macro
2024-12-20 12:33:25 +00:00
Chayim Refael Friedman
02d47f3a81 Fix a case where completion was unable to expand a macro
Which caused the macros of the popular `tracing` crate to not offer completions.

The reason is rather complicated: it boils down to macro ignoring their input and completion always choosing the first expansion.
2024-12-20 13:14:59 +02:00
Lukas Wirth
f3f8f4c6ad
Merge pull request #18728 from Veykril/push-ozqlrzmqklwt
internal: Split `serde` derive feature into `serde_derive` usage
2024-12-20 11:09:27 +00:00
Lukas Wirth
027daf1686
Merge pull request #18702 from ChayimFriedman2/prep
minor: Use a record struct instead of a tuple for each namespace in `PerNs`
2024-12-20 11:05:49 +00:00
Lukas Wirth
5211972743 internal: Split serde derive feature into serde_derive usage
Ideally we'd not have any dependency pull in the derive feature for faster build times, once that is the case this change would have an actual effect.
See https://github.com/matklad/macro-dep-test/blob/master/README.md for context.
2024-12-20 11:55:02 +01:00
Chayim Refael Friedman
b5486ffc42 Show substitution where hovering over generic things
There are few things to note in the implementation:

First, this is a best-effort implementation. Mainly, type aliases may not be shown (due to their eager nature it's harder) and partial pathes (aka. hovering over `Struct` in `Struct::method`) are not supported at all.

Second, we only need to show substitutions in expression and pattern position, because in type position all generic arguments always have to be written explicitly.
2024-12-20 11:30:19 +02:00
Lukas Wirth
e0c11f631e
Merge pull request #18726 from Veykril/push-vyzotyqqtpqs
fix: Reduce applicability of unnecessary_async assist
2024-12-20 07:56:23 +00:00
Lukas Wirth
0be03285f9 fix: Reduce applicability of unnecessary_async assist 2024-12-20 08:41:46 +01:00
Jacob Pratt
f8760f3689
Rollup merge of #134521 - adetaylor:roll-loop, r=wesleywiser
Arbitrary self types v2: roll loop.

Just for slightly more concise code - no functional changes.

r? `@wesleywiser`

Part of #44874
2024-12-20 01:36:48 -05:00
Jacob Pratt
e71c7496f6
Rollup merge of #134321 - dtolnay:docassocconst, r=fmease
Hide `= _` as associated constant value inside impl blocks

Closes #134320.

### Before:

<img src="https://github.com/user-attachments/assets/19d28811-45d2-4563-9726-f40c6af411c6" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/1ecf8764-97ce-47f0-87fa-3b174d2fc578" width="300">

### After:

<img src="https://github.com/user-attachments/assets/6408c4ca-b1c4-42e4-884b-248833a4865f" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/df2f6981-16f6-409f-8abb-73c0a4a71d6b" width="300">

r? `@fmease`
2024-12-20 01:36:47 -05:00
Jacob Pratt
0e21a9a205
Rollup merge of #133103 - tiif:fnabi, r=RalfJung
Pass FnAbi to find_mir_or_eval_fn

 https://github.com/rust-lang/miri/issues/4013 needs information from ``FnAbi``, hence it is passed to ``find_mir_or_eval_fn``.

r? `@RalfJung`
2024-12-20 01:36:47 -05:00
Jacob Pratt
58ac00f585
Rollup merge of #132830 - wr7:substr_range_documentation, r=tgross35
Rename `elem_offset` to `element_offset`

Tracking issue: #126769

Renames `slice::elem_offset` to `slice::element_offset` and improves the documentation of it and its related methods.

The current documentation can be misinterpreted (as explained [here](https://github.com/rust-lang/rust/issues/126769#issuecomment-2453363897)).
2024-12-20 01:36:46 -05:00
Jacob Pratt
969a1f526c
Rollup merge of #126118 - jan-ferdinand:docs_for_vec_set_len, r=the8472
docs: Mention `spare_capacity_mut()` in `Vec::set_len`

I recently went down a small rabbit hole when trying to identify safe use of `Vec::set_len`. The solution was `Vec::spare_capacity_mut`. I think the docs on `Vec::set_len` benefit from mentioning this method.

A possible counter-argument could be that the [clippy lint `uninit_vec`](https://rust-lang.github.io/rust-clippy/master/index.html#/uninit_vec) already nudges people in the right direction. However, I think a working example on `Vec::set_len` is still beneficial.

Happy to hear your thoughts on the matter. 😊
2024-12-20 01:36:45 -05:00
Ralf Jung
e693a9988b
Merge pull request #4100 from rust-lang/rustup-2024-12-20
Automatic Rustup
2024-12-20 06:29:50 +00:00
The Miri Cronjob Bot
40c34dd5cb Merge from rustc 2024-12-20 05:02:14 +00:00
bors
6c8cb99c2b Auto merge of #134438 - lqd:const-qualif-bitsets, r=compiler-errors
Use `MixedBitSet`s in const qualif

These analyses' domains should be very homogeneous, having compressed bitmaps on huge cfgs should make a difference (and doesn’t have an impact on the smaller / regular cfgs in our benchmarks).

This is a >40% walltime reduction on [this stress test](https://github.com/Manishearth/icu4x_compile_sample) extracted from a real world ICU case, and a 10x or so max-rss reduction.

cc `@oli-obk` `@RalfJung`

Should help with (or fix) issue #134404.
2024-12-20 04:48:19 +00:00
bors
5a36a75ab8 Auto merge of #134433 - MarcoIeni:ubuntu-22-large-runners, r=Kobzol
ci: use ubuntu-22 for large runners
2024-12-20 01:37:43 +00:00
bors
0c119ade56 Auto merge of #133793 - nnethercote:speed-up-expected_tokens, r=spastorino
Speed up `Parser::expected_tokens`

The constant pushing/clearing of `Parser::expected_tokens` during parsing is slow. This PR speeds it up greatly.

r? `@estebank`
2024-12-19 19:58:57 +00:00
bors
55c1dedde3 Auto merge of #134486 - compiler-errors:drop-for-lint, r=nikomatsakis
Make sure we handle `backwards_incompatible_lint` drops appropriately in drop elaboration

In #131326, a new kind of scheduled drop (`drop_kind: DropKind::Value` + `backwards_incompatible_lint: true`) was added so that we could insert a new kind of no-op MIR statement (`backward incompatible drop`) for linting purposes.

These drops were intended to have *no side-effects*, but drop elaboration code forgot to handle these drops specially and they were handled otherwise as normal drops in most of the code. This ends up being **unsound** since we insert more than one drop call for some values, which means that `Drop::drop` could be called more than once.

This PR fixes this by splitting out the `DropKind::ForLint` and adjusting the code. I'm not totally certain if all of the places I've adjusted are either reachable or correct, but I'm pretty certain that it's *more* correct than it was previously.

cc `@dingxiangfei2009`
r? nikomatsakis

Fixes #134482
2024-12-19 15:58:08 +00:00
Lukas Wirth
fe027d79d2
Merge pull request #18717 from Veykril/push-pomxnvxotwlr
internal: Set `result_id` for pull diagnostics
2024-12-19 15:38:32 +00:00
Lukas Wirth
c1a2955b50 internal: Set result_id for pull diagnostics 2024-12-19 16:24:18 +01:00
bors
6bddae206a Auto merge of #134499 - jieyouxu:rollup-zmaveur, r=jieyouxu
Rollup of 7 pull requests

Successful merges:

 - #133702 (Variants::Single: do not use invalid VariantIdx for uninhabited enums)
 - #134427 (ci: remove duplicate task definition)
 - #134432 (Fix intra doc links not generated inside footnote definitions)
 - #134437 (reduce compiler `Assemble` complexity)
 - #134474 (Forbid overwriting types in typeck)
 - #134477 (move lint_unused_mut into sub-fn)
 - #134491 (Some destructor/drop related tweaks)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-19 11:25:43 +00:00
许杰友 Jieyou Xu (Joe)
b60f0674fd
Rollup merge of #134491 - compiler-errors:dtor-tweaks, r=lqd
Some destructor/drop related tweaks

Two random tweaks I got from investigating some stuff around drops in edition 2024:
1. Use the `TypingEnv` of the mir builder, rather than making it over again.
2. Rename the `id` field from `Scope` to `local_id`, to reflect that it's a local id, and remove the `item_local_id()` accessor which just returned the id field.
2024-12-19 16:48:11 +08:00
许杰友 Jieyou Xu (Joe)
ea28453726
Rollup merge of #134477 - lcnr:move-lint-into-subfn, r=lqd
move lint_unused_mut into sub-fn

also, stop `mem::take`-ing stuff we only use by reference 🤷
2024-12-19 16:48:11 +08:00
许杰友 Jieyou Xu (Joe)
505ab3885b
Rollup merge of #134474 - oli-obk:push-yomnkntvzlxw, r=compiler-errors
Forbid overwriting types in typeck

While trying to figure out some type setting logic in https://github.com/rust-lang/rust/pull/134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
2024-12-19 16:48:10 +08:00
许杰友 Jieyou Xu (Joe)
5305b0255b
Rollup merge of #134437 - onur-ozkan:improve-compiler-build, r=jieyouxu
reduce compiler `Assemble` complexity

`compile::Assemble` is already complicated by its nature (as it handles core internals like recursive building logic, etc.) and also handles half of `LldWrapper` tool logic for no good reason since it should be done in the build step directly.

This change moves it there to reduce complexity of `compile::Assemble` logic.
2024-12-19 16:48:09 +08:00
许杰友 Jieyou Xu (Joe)
4f1eabf1b1
Rollup merge of #134432 - GuillaumeGomez:intra-doc-in-footnotes, r=notriddle
Fix intra doc links not generated inside footnote definitions

Fixes #132208.

The problem was that we were running the `Footnote` "pass" before the `LinkReplacer` one. Sadly, the change is bigger than it should because we can't specialize the `Iterator` trait implementation, forcing me to add a new type to handle the other `Iterator` kind (the one which still has the `Range`).

r? ``@notriddle``
2024-12-19 16:48:09 +08:00
许杰友 Jieyou Xu (Joe)
d40e2a59a1
Rollup merge of #134427 - MarcoIeni:ci-remove-code-duplication, r=Kobzol
ci: remove duplicate task definition

try-job: x86_64-gnu-llvm-19-1
try-job: x86_64-gnu-llvm-19-2
try-job: x86_64-gnu-llvm-19-3
try-job: x86_64-gnu-llvm-18-1
try-job: x86_64-gnu-llvm-18-2
try-job: x86_64-gnu-llvm-18-3
try-job: i686-gnu-1
try-job: i686-gnu-2
try-job: i686-gnu-nopt-1
try-job: i686-gnu-nopt-2
2024-12-19 16:48:08 +08:00
许杰友 Jieyou Xu (Joe)
e95b48b6d9
Rollup merge of #133702 - RalfJung:single-variant, r=oli-obk
Variants::Single: do not use invalid VariantIdx for uninhabited enums

~~Stacked on top of https://github.com/rust-lang/rust/pull/133681, only the last commit is new.~~

Currently, `Variants::Single` for an empty enum contains a `VariantIdx` of 0; looking that up in the enum variant list will ICE. That's quite confusing. So let's fix that by adding a new `Variants::Empty` case for types that have 0 variants.

try-job: i686-msvc
2024-12-19 16:48:07 +08:00
bors
c6e1649b42 Auto merge of #133328 - nnethercote:simplify-SwitchInt-handling, r=tmiasko
Simplify `SwitchInt` handling

Dataflow handling of `SwitchInt` is currently complicated. This PR simplifies it.

r? `@cjgillot`
2024-12-18 22:57:23 +00:00
Oli Scherer
4c639105f0
Merge pull request #4072 from tiif/blockop
Implement blocking unnamed_socket
2024-12-18 19:23:42 +00:00
Lukas Wirth
27fac08c82
Merge pull request #18715 from aibaars/ungram-asm-option
Fix AsmOption rule in rust.ungram
2024-12-18 14:22:05 +00:00
Lukas Wirth
a229bc8e79
Merge pull request #18716 from Veykril/push-lyxuzrnkmklp
fix: Consider both completion detail fields in to_proto
2024-12-18 14:14:39 +00:00
Lukas Wirth
e89d72056b fix: Consider both completion detail fields in to_proto 2024-12-18 15:00:09 +01:00
Arthur Baars
cb2829eaa7 Fix AsmOption rule in rust.ungram 2024-12-18 14:56:00 +01:00
bors
33a0d73dd2 Auto merge of #134428 - nikic:llvm-19.1.6, r=cuviper
Update to LLVM 19.1.6

Fixes the wasm64 build failure reported at https://github.com/rust-lang/llvm-project/pull/180.
2024-12-18 13:28:28 +00:00
Lukas Wirth
e1b7d77ead
Merge pull request #18714 from Veykril/push-krxvsqwrokwp
fix: Do not ask the client to resolve for non existing label details
2024-12-18 13:24:53 +00:00
Lukas Wirth
683150f4da fix: Do not ask the client ro resolve for non existing label details 2024-12-18 14:03:50 +01:00
Lukas Wirth
d7fa33e2d0
Merge pull request #18713 from Veykril/push-zmmkzspnwxsn
internal: Cleanup label structure of `CompletionItem`
2024-12-18 12:53:07 +00:00
Lukas Wirth
540ada516a internal: Cleanup label structure of CompletionItem 2024-12-18 13:37:21 +01:00
Lukas Wirth
c70b07b3c9
Merge pull request #18711 from Veykril/push-kwurwxttmqwo
Taking a raw ref of a deref is always safe
2024-12-18 10:47:07 +00:00