about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-14Auto merge of #18265 - kouhe3:master, r=Veykrilbors-0/+30
Add support for LLDB-DAP
2024-10-14Auto merge of #18252 - ShoyuVanilla:issue-15799, r=Veykrilbors-1/+37
fix: Do not consider mutable usage of deref to `*mut T` as deref_mut Fixes #15799 We are doing some heuristics for deciding whether the given deref is deref or deref_mut here; https://github.com/rust-lang/rust-analyzer/blob/5982d9c420d0dc90739171829f0d2e9c80d98979/crates/hir-ty/src/infer/mutability.rs#L182-L200 But this heuristic is erroneous if we are dereferencing to a mut ptr and normally those cases are filtered out here as builtin; https://github.com/rust-lang/rust-analyzer/blob/5982d9c420d0dc90739171829f0d2e9c80d98979/crates/hir-ty/src/mir/lower/as_place.rs#L165-L177 Howerver, this works not so well if the given dereferencing is double dereferencings like the case in the #15799. ```rust struct WrapPtr(*mut u32); impl core::ops::Deref for WrapPtr { type Target = *mut u32; fn deref(&self) -> &Self::Target { &self.0 } } fn main() { let mut x = 0u32; let wrap = WrapPtr(&mut x); unsafe { **wrap = 6; } } ``` Here are two - outer and inner - dereferences here, and the outer dereference is marked as deref_mut because there is an assignment operation. And this deref_mut marking is propagated into the inner dereferencing. In the later MIR lowering, the outer dereference is filtered out as it's expr type is `*mut u32`, but the expr type in the inner dereference is an ADT, so this false-mutablility is not filtered out. This PR cuts propagation of this false mutablilty chain if the expr type is mut ptr. Since this happens before the resolve_all, it may have some limitations when the expr type is determined as mut ptr at the very end of inferencing, but I couldn't find simple fix for it 🤔
2024-10-14Auto merge of #18242 - Veykril:veykril/push-tnynzqsmtnqw, r=Veykrilbors-185/+174
internal: Don't resolve extern crates in import fix point resolution The fix point loop won't progress them given the potential extern crate candidates are set up at build time.
2024-10-14Auto merge of #18229 - mrkajetanp:rustfmt-path, r=Veykrilbors-3/+3
fix: Join rustfmt overrideCommand with project root When providing a custom rustfmt command, join it with the project root instead of the workspace root. This fixes rust-analyzer getting the wrong invocation path in projects containing subprojects. This makes the behaviour consistent with how a custom path provided in rust-analyzer.procMacro.server behaves already. Resolves issue #18222
2024-10-14Auto merge of #18217 - ChayimFriedman2:cast-unknown-ptr, r=Veykrilbors-25/+48
fix: Comment out cast checks for unknown ptr kind Just like we don't check for types containing unknown. Fixes #18214. See also https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Another.20case.20of.20.2318064.3F.
2024-10-14Auto merge of #18152 - CryZe:highlight-async-block-exit-points, r=Veykrilbors-73/+101
feat: Highlight exit points of async blocks Async blocks act similar to async functions in that the await keywords are related, but also act like functions where the exit points are related. Fixes #18147
2024-10-14Auto merge of #18226 - SabrinaJewson:fix-impl-use, r=Veykrilbors-1/+29
Correctly parse `use` in generic parameters Fixes: #18225
2024-10-12Auto merge of #18281 - darichey:async-subprocess, r=lnicolabors-32/+83
Run subprocesses async in vscode extension Extensions should not block the vscode extension host. Replace uses of `spawnSync` with `spawnAsync`, a convenience wrapper around `spawn`. These `spawnSync`s are unlikely to cause a real issue in practice, because they spawn very short-lived processes, so we aren't blocking for very long. That said, blocking the extension host is poor practice, and if they _do_ block for too long for whatever reason, vscode becomes useless.
2024-10-12Auto merge of #18289 - darichey:fix-relative-buildfiles, r=lnicolabors-1/+1
Fix panic when json project has relative buildfile paths The `build_file` path may be relative to the workspace root.
2024-10-12Fix panic when json project has relative buildfile pathsDavid Richey-1/+1
2024-10-10Run subprocesses async in vscode extensionDavid Richey-32/+83
2024-10-09Auto merge of #18245 - boattime:master, r=davidbarskybors-2/+2
fix: include description in label details when detail field is marked for … Fixes https://github.com/rust-lang/rust-analyzer/issues/18231. When omitting the autocomplete detail field, the autocomplete label details can still be returned. Currently the label details are missing the description field if the detail field is included in resolveSupport since it is being overwritten as None and opted to be sent with `completionItem/resolve`. Example completion capabilities. ``` completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } } ```
2024-10-09Auto merge of #18247 - jhgg:lsp/fix-something-to-resolve, r=Veykrilbors-7/+7
lsp: fix completion_item something_to_resolve not being a latch to true while looking at #18245 i noticed that `something_to_resolve` could technically flap between true -> false if some subsequent fields that were requested to be resolved were empty. this fixes that by using `|=` instead of `=` when assigning to `something_to_resolve` which will prevent it from going back to false once set. although some cases it's simply assigning to `true` i opted to continue to use `|=` there for uniformity sake. but happy to change those back to `=`'s. cc `@SomeoneToIgnore`
2024-10-09Auto merge of #18246 - ChayimFriedman2:fix-18238, r=Veykrilbors-1/+34
fix: Fix `prettify_macro_expansion()` when the node isn't the whole file Fixes #18238.
2024-10-09Auto merge of #18269 - jhgg:hir-ty/change-struct-constructor-formatting, ↵bors-71/+65
r=flodiebold hir-ty: change struct + enum variant constructor formatting. before, when formatting struct constructor for `struct S(usize, usize)` it would format as: extern "rust-call" S(usize, usize) -> S but after this change, we'll format as: fn S(usize, usize) -> S likewise the second commit, also makes this uniform for enum variants as well. fixes #18259
2024-10-08Only Highlight Exit Points on `async` TokenChristopher Serr-7/+13
This ensures that when being on an `await` token, it still only highlights the yield points and not the exit points.
2024-10-08include fn prefix for all callable defsJake-36/+29
2024-10-08hir-ty: change struct constructor formatting.Jake-53/+54
before, when formatting struct constructor for `struct S(usize, usize)` it would format as: extern "rust-call" S(usize, usize) -> S but after this change, we'll format as: fn S(usize, usize) -> S
2024-10-08Auto merge of #18267 - lnicola:sync-from-rust, r=lnicolabors-17325/+34070
minor: Sync from downstream
2024-10-08Merge from rust-lang/rustLaurențiu Nicola-17324/+34069
2024-10-08Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-10-08Auto merge of #18266 - lnicola:macos-13, r=lnicolabors-3/+3
internal: Use macos-13 runners and bump MACOSX_DEPLOYMENT_TARGET to 13.0 As Monterey seems to be EOL.
2024-10-08Use macos-13 runners and bump MACOSX_DEPLOYMENT_TARGETLaurențiu Nicola-3/+3
2024-10-08prettier formatkouhe3-14/+13
2024-10-08semicolonkouhe3-1/+1
2024-10-08fix array sourceMapkouhe3-9/+19
2024-10-08lldbdap env dict to stringkouhe3-2/+3
2024-10-08Auto merge of #126733 - ZhuUx:llvm-19-adapt, r=Zalatharbors-572/+573
[Coverage][MCDC] Adapt mcdc to llvm 19 Related issue: #126672 Also finish task 4 at #124144 [llvm #82448](https://github.com/llvm/llvm-project/pull/82448) has introduced some break changes into mcdc, causing incompatibility between llvm 18 and 19. This draft adapts to that change and gives up supporting for llvm-18.
2024-10-08Auto merge of #131387 - Zalathar:rollup-kprp512, r=Zalatharbors-59/+204
Rollup of 7 pull requests Successful merges: - #130824 (Add missing module flags for `-Zfunction-return=thunk-extern`) - #131170 (Fix `target_vendor` in non-IDF Xtensa ESP32 targets) - #131355 (Add tests for some old fixed issues) - #131369 (Update books) - #131370 (rustdoc: improve `<wbr>`-insertion for SCREAMING_CAMEL_CASE) - #131379 (Fix utf8-bom test) - #131385 (Un-vacation myself) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-08coverage. Warn about too many test vectorszhuyunxing-1/+17
2024-10-08coverage. Adapt to mcdc mapping formats introduced by llvm 19zhuyunxing-488/+493
2024-10-08coverage. MCDC ConditionId start from 0 to keep with llvm 19zhuyunxing-31/+27
2024-10-08coverage. Disable supporting mcdc on llvm-18zhuyunxing-54/+38
2024-10-08Rollup merge of #131385 - jieyouxu:unvac, r=jieyouxuStuart Cook-1/+0
Un-vacation myself r? `@ghost`
2024-10-08Rollup merge of #131379 - ehuss:fix-utf8-bom, r=jieyouxuStuart Cook-3/+1
Fix utf8-bom test The BOM was accidentally removed in https://github.com/rust-lang/rust/pull/57108 I had to move the run-pass line down, because compiletest doesn't seem to know about BOMs, so it does not parse the header if it is the first line.
2024-10-08Rollup merge of #131370 - notriddle:notriddle/screaming-camel-case, ↵Stuart Cook-1/+15
r=GuillaumeGomez rustdoc: improve `<wbr>`-insertion for SCREAMING_CAMEL_CASE
2024-10-08Rollup merge of #131369 - rustbot:docs-update, r=ehussStuart Cook-0/+0
Update books ## rust-lang/book 8 commits in 99cf75a5414fa8adbe3974bd0836661ca901708f..f38ce8baef98cb20229e56f1be2d50e345f11792 2024-10-07 13:21:46 UTC to 2024-09-25 22:46:26 UTC - Swap assert_eq! parameters (rust-lang/book#4058) - Add a short discussion of assignment and ownership in ch. 04 (rust-lang/book#4049) - Standardize on 'adapter', not 'adaptor' (rust-lang/book#4057) - A bit more clarity about all the stack types in 3.2 (rust-lang/book#4055) - Mention move of individual struct fields in struct update syntax (rust-lang/book#4046) - Convert ch05 to `<Listing>` (rust-lang/book#4051) - Convert ch04 to `<Listing>` (rust-lang/book#4043) - Fixed Ukrainian translation link to community repo (rust-lang/book#4039) ## rust-embedded/book 1 commits in dbae36bf3f8410aa4313b3bad42e374735d48a9d..f40a8b420ec4b4505d9489965e261f1d5c28ba23 2024-09-30 19:16:36 UTC to 2024-09-30 19:16:36 UTC - Update macOS installation instructions (rust-embedded/book#379) ## rust-lang/nomicon 1 commits in 14649f15d232d509478206ee9ed5105641aa60d0..456b904f791751892b01282fd2757904993c4c26 2024-10-05 17:29:16 UTC to 2024-10-05 17:29:16 UTC - Improve/fix description of drops (rust-lang/nomicon#465) ## rust-lang/reference 7 commits in 24fb2687cdbc54fa18ae4acf5d879cfceca77b2c..c64e52a3d306eac0129f3ad6c6d8806ab99ae2e9 2024-10-05 00:33:03 UTC to 2024-09-24 22:04:59 UTC - Fix inline-assembly documentation for LoongArch (rust-lang/reference#1644) - Explain how to name rule identifiers (rust-lang/reference#1609) - Add `expr_2021` macro fragment specifier (rust-lang/reference#1580) - Add spec identifier syntax to macro subchapters (rust-lang/reference#1625) - Authoring guide: clarify standard library linking (rust-lang/reference#1629) - Add spec identifiers to comments.md (rust-lang/reference#1563) - Add identifier syntax to visibility-and-privacy.md (rust-lang/reference#1627) ## rust-lang/rust-by-example 3 commits in c79ec345f08a1e94494cdc8c999709a90203fd88..8bede1b919a81ab7d0c961f6bbf68d3efa297bd2 2024-09-30 13:38:03 UTC to 2024-09-30 13:32:58 UTC - Minor improvements (rust-lang/rust-by-example#1888) - Clarify that the associated type is also required by the Iterator trait (rust-lang/rust-by-example#1887) - Add Chinese(zh) translation (rust-lang/rust-by-example#1886) ## rust-lang/rustc-dev-guide 34 commits in 555f3de2fa0d61c4294b74d245f1cbad6fcbf589..07bc9ca9eb1cd6d9fbbf758c2753b748804a134f 2024-10-07 15:09:03 UTC to 2024-09-24 17:49:14 UTC - rustdoc: docs for search deduplication (rust-lang/rustc-dev-guide#1850) - Revise test naming advice to discourage using issue numbers alone (rust-lang/rustc-dev-guide#2090) - Document `bootstrap` integration with `rustc-perf` (rust-lang/rustc-dev-guide#2005) - building: Update instructions for ./x setup editor (rust-lang/rustc-dev-guide#2086) - [Testing 2/2] Revise revisions docs (rust-lang/rustc-dev-guide#2089) - [Testing 1/2] Revise testing chapters excluding the directives chapter (rust-lang/rustc-dev-guide#2088) - Fixed links to rust-analyzer configs for Emacs and Helix (rust-lang/rustc-dev-guide#2087) - update `x install` documentation (rust-lang/rustc-dev-guide#2084) - Rename "object safe" to "dyn compatible" (rust-lang/rustc-dev-guide#2083) - Small follow-up to my "internal `#[rustc_*]` TEST attributes" PR (rust-lang/rustc-dev-guide#2082) - Add documentation for `{{rust-src-base}}` (rust-lang/rustc-dev-guide#2079) - building/suggested: Add instructions for Emacs & Helix (rust-lang/rustc-dev-guide#2080) - Fix file paths to section 35.1 & 35.2 example code (rust-lang/rustc-dev-guide#2078) - Clarify how to disable warnings in deps (rust-lang/rustc-dev-guide#2015) - Update compiler-src.md (rust-lang/rustc-dev-guide#1899) - Update rustdoc build instructions (rust-lang/rustc-dev-guide#1917) - Update salsa.md (rust-lang/rustc-dev-guide#1906) - Update memory.md (rust-lang/rustc-dev-guide#1907) - Update serialization.md (rust-lang/rustc-dev-guide#1909) - update rustc-driver.md (rust-lang/rustc-dev-guide#1929) - Update syntax-intro.md (rust-lang/rustc-dev-guide#1932) - Update the-parser.md (rust-lang/rustc-dev-guide#1933) - Update macro-expansion.md (rust-lang/rustc-dev-guide#1934) - Clarify a little bit in MIR chapter (rust-lang/rustc-dev-guide#1986) - Update name-resolution.md (rust-lang/rustc-dev-guide#1935) - feat: Add section about partial clones with `git clone --filter='blob:none'` (rust-lang/rustc-dev-guide#2035) - Mention rustc's stable-item-through-unstable-path bug being fixed (rust-lang/rustc-dev-guide#2064) - Fix `is_diagnostic_item()` example (rust-lang/rustc-dev-guide#2013) - Revise lldb debuginfo note wording to not imply *only* Python 3.10 can be installed (rust-lang/rustc-dev-guide#2077) - Document `crashes` test suite (rust-lang/rustc-dev-guide#2075) - Fix getting diagnostics example (rust-lang/rustc-dev-guide#2067) - Document `#[rustc_default_body_unstable]` (rust-lang/rustc-dev-guide#2065) - Describe `.git-blame-ignore-rev` (rust-lang/rustc-dev-guide#2072) - Note lldb debuginfo requires `python310.dll` to be present in `PATH` on Windows (rust-lang/rustc-dev-guide#2076)
2024-10-08Rollup merge of #131355 - clubby789:old-tests, r=jieyouxuStuart Cook-53/+166
Add tests for some old fixed issues Closes #30867 Closes #30472 Closes #28994 Closes #26719 (and migrates the relevant test to the new run-make) Closes #23600 cc `@jieyouxu` for the run-make-support changes try-job: x86_64-msvc
2024-10-08Rollup merge of #131170 - madsmtm:target-info-esp32-vendor, r=workingjubileeStuart Cook-0/+3
Fix `target_vendor` in non-IDF Xtensa ESP32 targets `rustc`'s Xtensa ESP32 targets are the following: - `xtensa-esp32-none-elf` - `xtensa-esp32-espidf` - `xtensa-esp32s2-none-elf` - `xtensa-esp32s2-espidf` - `xtensa-esp32s3-none-elf` - `xtensa-esp32s3-espidf` The ESP-IDF targets already set `target_vendor="espressif"`, however, the ESP32 is, from my understanding, produced by Espressif regardless of whether using the IDF or not, so we should set the target vendor there as well?
2024-10-08Rollup merge of #130824 - Darksonn:fix-function-return, r=wesleywiserStuart Cook-1/+19
Add missing module flags for `-Zfunction-return=thunk-extern` This fixes a bug in the `-Zfunction-return=thunk-extern` flag. The flag needs to be passed onto LLVM to ensure that functions such as `asan.module_ctor` and `asan.module_dtor` that are created internally in LLVM have the mitigation applied to them. This was originally discovered [in the Linux kernel](https://lore.kernel.org/all/CANiq72myZL4_poCMuNFevtpYYc0V0embjSuKb7y=C+m3vVA_8g@mail.gmail.com/). Original flag PR: #116892 PR for similar issue: #129373 Tracking issue: #116853 cc ``@ojeda`` r? ``@wesleywiser``
2024-10-08Auto merge of #130251 - saethlin:ptr-offset-preconditions, r=Amanieubors-5/+188
Add precondition checks to ptr::offset, ptr::add, ptr::sub All of `offset`, `add`, and `sub` (currently) have the trivial preconditions that the offset in bytes must be <= isize::MAX, and the computation of the new address must not wrap. This adds precondition checks for these, and like in slice indexing, we use intrinsics directly to implement unsafe APIs that have explicit checks, because we get a clearer error message that mentions the misused API not an implementation detail. Experimentation indicates these checks have 1-2% compile time overhead, due primarily to adding the checks for `add`. A crater run (https://github.com/rust-lang/rust/pull/130251#issuecomment-2395824565) indicates some people currently have buggy calls to `ptr::offset` that apply a negative offset to a null pointer, but the crater run does not hit the `ptr::add` or `ptr::sub` checks, which seems like an argument for cfg'ing out those checks on account of their overhead.
2024-10-07Remove myself from vacation许杰友 Jieyou Xu (Joe)-1/+0
2024-10-07Fix utf8-bom testEric Huss-3/+1
The BOM was accidentally removed in https://github.com/rust-lang/rust/pull/57108
2024-10-07Auto merge of #131343 - compiler-errors:remove-combine-fields, r=lcnrbors-281/+168
Remove `CombineFields` This conflicts with #131263, but if this one lands first then perhaps #131263 could then go ahead and remove all the branching on solver in `TypeRelating`. We could perhaps then rename `TypeRelating` to `OldSolverRelating` or something, idk. r? lcnr
2024-10-07Add comment to describe camelcase line breakMichael Howell-0/+10
2024-10-07Auto merge of #131372 - workingjubilee:rollup-4tyqgx2, r=workingjubileebors-703/+254
Rollup of 7 pull requests Successful merges: - #128721 (Don't allow the `#[pointee]` attribute where it doesn't belong) - #130479 (skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on) - #130899 (Couple of changes to make it easier to compile rustc for wasm) - #131225 (`rustc_borrowck` memory management tweaks) - #131351 (Remove valgrind test suite and support from compiletest, bootstrap and opt-dist) - #131359 (Fix used_underscore_binding in rustc_serialize) - #131367 (Mark Boxy as on vacation) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-07Rollup merge of #131367 - compiler-errors:unboxy, r=lqdJubilee-0/+1
Mark Boxy as on vacation Boxy asked me to do this since she's busy :D cc `@BoxyUwU`
2024-10-07Rollup merge of #131359 - practicalrs:fix_used_underscore_binding, r=jieyouxuJubilee-3/+3
Fix used_underscore_binding in rustc_serialize Hi, This PR fixes the following clippy warnings in rustc_serialize ``` warning: used underscore-prefixed binding --> compiler/rustc_serialize/src/opaque.rs:443:27 | 443 | debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE); | ^^^^^^^^ | note: binding is defined here --> compiler/rustc_serialize/src/opaque.rs:442:13 | 442 | let _end_pos = e.position(); | ^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding = note: requested on the command line with `-W clippy::used-underscore-binding` warning: used underscore-prefixed binding --> compiler/rustc_serialize/src/opaque.rs:443:38 | 443 | debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE); | ^^^^^^^^^^ | note: binding is defined here --> compiler/rustc_serialize/src/opaque.rs:440:13 | 440 | let _start_pos = e.position(); | ^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding ``` Best regards, Michal
2024-10-07Rollup merge of #131351 - jieyouxu:yeet-the-valgrind, r=KobzolJubilee-619/+29
Remove valgrind test suite and support from compiletest, bootstrap and opt-dist The `run-pass-valgrind` test suite is not exercised in CI, and as far as I'm aware nobody runs it (asked in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Are.20the.20valgrind.20tests.20even.20used.20by.20anyone.3F). What's remaining of valgrind support in compiletest isn't even properly hooked up with bootstrap. The existing valgrind logic in compiletest is also straight up questionable, i.e. https://github.com/rust-lang/rust/blob/1b3b8e7b0265162853c650ead09905bc3cdaeae9/src/tools/compiletest/src/runtest/valgrind.rs#L7-L12 It just runs valgrind tests as `rpass` if no valgrind path is provided to compiletest from bootstrap -- but bootstrap doesn't even pass a valgrind path to compiletest in the first place, so this always ran as `rpass` tests. So what is this even testing? So if it's not testing anything, let's delete it. Closes #44816 by deleting the test suite :3 <img src="https://github.com/user-attachments/assets/99525bf7-e85b-40ba-9281-e4e1e275c4e8" width=300 />
2024-10-07Rollup merge of #131225 - nnethercote:rustc_borrowck-mm, r=lqdJubilee-70/+58
`rustc_borrowck` memory management tweaks Minor cleanups in `rustc_borrowck` relating to memory management. r? `@lqd`