about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-15Auto merge of #17587 - joshka:jm/edit-name-after-refactor, r=Veykrilbors-36/+80
Trigger VSCode to rename after extract variable assist is applied When the user applies the "Extract Variable" assist, the cursor is positioned at the newly inserted variable. This commit adds a command to the assist that triggers the rename action in VSCode. This way, the user can quickly rename the variable after applying the assist. Fixes part of: #17579 https://github.com/user-attachments/assets/4cf38740-ab22-4b94-b0f1-eddd51c26c29 I haven't yet looked at the module or function extraction assists yet.
2024-07-15Auto merge of #17584 - Veykril:landing-page, r=Veykrilbors-792/+1418
Implement symbol interning infra Will fix https://github.com/rust-lang/rust-analyzer/issues/15590 My unsafe-fu is not the best but it does satisfy miri. There is still some follow up work to do, notably a lot of places using strings instead of symbols/names, most notably the token tree.
2024-07-15Fix stable iteration ordering for `Map<Name, ...>` usagesLukas Wirth-29/+55
2024-07-14Use statics + clone instead of const until const can access staticsLukas Wirth-368/+395
2024-07-14Auto merge of #17594 - anitahammer:patch-1, r=lnicolabors-1/+1
minor: Update manual.adoc
2024-07-14Update manual.adocAnita Hammer-1/+1
2024-07-13Address feedback from @DropDemBitsJosh McKinney-13/+10
- move `edit.rename()` to the end of the function - use a match statement to set `res.command`
2024-07-12Trigger VSCode to rename after extract variable assist is appliedbors-33/+80
When the user applies the "Extract Variable" assist, the cursor is positioned at the newly inserted variable. This commit adds a command to the assist that triggers the rename action in VSCode. This way, the user can quickly rename the variable after applying the assist. Fixes part of: #17579
2024-07-12Fix cloning Symbols not increasing their ref countLukas Wirth-28/+63
2024-07-12Use Symbol in NameLukas Wirth-761/+756
2024-07-12Add missing docsLukas Wirth-1/+2
2024-07-12Implement rough symbol interning infraLukas Wirth-1/+543
2024-07-11Auto merge of #17581 - lnicola:sync-from-rust, r=lnicolabors-36968/+71726
minor: Sync from rust
2024-07-11Merge from rust-lang/rustLaurențiu Nicola-36967/+71725
2024-07-11Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-07-11Auto merge of #127487 - tgross35:f16-f128-simd, r=Amanieubors-0/+2
Add `f16` and `f128` as simd types in LLVM `@sayantn` is working on adding SIMD for `f16` and hitting the `FloatingPointVector` error. This should fix it and unblock adding support for `simd_fma` and `simd_fabs` in stdarch.
2024-07-11Auto merge of #127311 - oli-obk:do_not_count_errors, r=compiler-errorsbors-211/+37
Avoid follow-up errors and ICEs after missing lifetime errors on data structures Tuple struct constructors are functions, so when we call them typeck will use the signature tuple struct constructor function to provide type hints. Since typeck mostly ignores and erases lifetimes, we end up never seeing the error lifetime in writeback, thus not tainting the typeck result. Now, we eagerly taint typeck results by tainting from `resolve_vars_if_possible`, which is called all over the place. I did not carry over all the `crashes` test suite tests, as they are really all the same cause (missing or unknown lifetime names in tuple struct definitions or generic arg lists). fixes #124262 fixes #124083 fixes #125155 fixes #125888 fixes #125992 fixes #126666 fixes #126648 fixes #127268 fixes #127266 fixes #127304
2024-07-11Avoid follow-up errors and ICEs after missing lifetime errors on data structuresOli Scherer-211/+37
2024-07-11Auto merge of #126777 - Zalathar:normalize-colon, r=lcnrbors-245/+235
Require a colon in `//@ normalize-*:` test headers The previous parser for `//@ normalize-*` headers (before #126370) was so lax that it did not require `:` after the header name. As a result, the test suite contained a mix of with-colon and without-colon normalize headers, both numbering in the hundreds. This PR updates the without-colon headers to add a colon (matching the style used by other headers), and then updates the parser to make the colon mandatory. (Because the normalization parser only runs *after* the header system identifies a normalize header, this will detect and issue an error for relevant headers that lack the colon.) Addresses one of the points of #126372.
2024-07-11Auto merge of #17571 - winstxnhdw:bool-to-enum-no-dupe, r=Veykrilbors-3/+44
feat: do not add new enum if it already exists ## Summary This PR introduces a check for the existence of another enum within the current scope, and if it exist, we skip `add_enum_def`. ## Why? Currently, when using the `bool_to_enum` assist more than once, it is possible to add multiple enum definitions. For example, the following snippet, ```rs #[derive(PartialEq, Eq)] enum Bool { True, False, } fn main() { let a = Bool::True; let b = true; println!("Hello, world!"); } ``` will be transformed into, ```rs #[derive(PartialEq, Eq)] enum Bool { True, False, } #[derive(PartialEq, Eq)] enum Bool { True, False, } fn main() { let a = Bool::True; let b = Bool::True; println!("Hello, world!"); } ``` This can be annoying for users to clean up.
2024-07-11Auto merge of #127097 - compiler-errors:async-closure-lint, r=oli-obkbors-20/+242
Implement simple, unstable lint to suggest turning closure-of-async-block into async-closure We want to eventually suggest people to turn `|| async {}` to `async || {}`. This begins doing that. It's a pretty rudimentary lint, but I wanted to get something down so I wouldn't lose the code. Tracking: * #62290
2024-07-11Auto merge of #127575 - chenyukang:yukang-fix-struct-fields-ice, ↵bors-32/+131
r=compiler-errors Avoid "no field" error and ICE on recovered ADT variant Fixes https://github.com/rust-lang/rust/issues/126744 Fixes https://github.com/rust-lang/rust/issues/126344, a more general fix compared with https://github.com/rust-lang/rust/pull/127426 r? `@oli-obk` From `@compiler-errors` 's comment https://github.com/rust-lang/rust/pull/127502#discussion_r1669538204 Seems most of the ADTs don't have taint, so maybe it's not proper to change `TyCtxt::type_of` query.
2024-07-11Require a colon in `//@ normalize-*:` headersZalathar-17/+7
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-228/+228
2024-07-11Auto merge of #127538 - Oneirical:the-sacred-tests, r=jieyouxubors-68/+78
Migrate `issue-83112-incr-test-moved-file`, `type-mismatch-same-crate-name` and `issue-109934-lto-debuginfo` `run-make` tests to rmake or ui Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). I have noticed that the new UI test `debuginfo-lto-alloc` is outputting artifacts that aren't getting cleaned up because of its `-C incremental`. That might be the justification needed to keep it as a run-make test? Try it on: // try-job: test-various // previously passed try-job: armhf-gnu try-job: aarch64-apple try-job: x86_64-msvc
2024-07-10Auto merge of #127560 - oli-obk:safe_clobber, r=nnethercotebors-14/+3
Make `visit_clobber`'s impl safe This was originally introduced in #58061 but I didn't see any perf discussion about it, so let's see what perf says. r? `@nnethercote`
2024-07-10refactor: search for enum semanticallywinstxnhdw-6/+8
2024-07-10Auto merge of #127419 - trevyn:issue-125446, r=fee1-deadbors-147/+309
Add suggestions for possible missing `fn`, `struct`, or `enum` keywords Closes #125446 Closes #65381
2024-07-10Auto merge of #17576 - Veykril:landing-page, r=Veykrilbors-51/+12
internal: Remove faq landing page, improve main one Having more than one is potentialyl annoying as both will get opened upon install, using walkthroughs for this is not ideal. So this merges the two and also adds a couple tips, fixes https://github.com/rust-lang/rust-analyzer/issues/17569
2024-07-10Remove faq landing page, improve main oneLukas Wirth-51/+12
2024-07-11report pat no field error no recoverd struct variantyukang-32/+131
2024-07-10Auto merge of #127580 - matthiaskrgr:rollup-pjw1xmj, r=matthiaskrgrbors-320/+224
Rollup of 7 pull requests Successful merges: - #126476 (Fix running bootstrap tests with a local Rust toolchain as the stage0) - #127094 (E0191 suggestion correction, inserts turbofish) - #127554 ( do not run test where it cannot run) - #127564 (Temporarily remove me from review rotation.) - #127568 (instantiate higher ranked goals in candidate selection again) - #127569 (Fix local download of Docker caches from CI) - #127570 ( small normalization improvement) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-10Rollup merge of #127570 - lcnr:normalize-cool, r=compiler-errorsMatthias Krüger-13/+10
small normalization improvement r? `@compiler-errors`
2024-07-10Rollup merge of #127569 - Kobzol:ci-fix-docker-local-rebuild, r=nikicMatthias Krüger-1/+1
Fix local download of Docker caches from CI https://github.com/rust-lang/rust/pull/127312 broke local downloads of Docker caches from CI, when you wanted to build a Docker image locally. This PR fixes that. r? `@nikic` (Can you please check if the cache works for you with this PR?)
2024-07-10Rollup merge of #127568 - lcnr:undo-leakcheck, r=oli-obkMatthias Krüger-299/+121
instantiate higher ranked goals in candidate selection again This reverts #119820 as that PR has a significant impact and breaks code which *feels like it should work*. The impact ended up being larger than we expected during the FCP and we've ended up with some ideas for how we can work around this issue in the next solver. This has been discussed in the previous high bandwidth t-types meeting: https://rust-lang.zulipchat.com/#narrow/stream/326132-t-types.2Fmeetings/topic/2024-07-09.20high.20bandwidth.20meeting. We'll therefore keep this inconsistency between the two solvers for now and will have to deal with it before stabilizating the use of the new solver outside of coherence: https://github.com/rust-lang/trait-system-refactor-initiative/issues/120. fixes #125194 after a beta-backport. The pattern which is more widely used than expected and feels like it should work, especially without deep knowledge of the type system is ```rust trait Trait<'a> {} impl<'a, T> Trait<'a> for T {} fn trait_bound<T: for<'a> Trait<'a>>() {} // A function with a where-bound which is more restrictive than the impl. fn function1<T: Trait<'static>>() { // stable: ok // with #119820: error as we prefer the where-bound over the impl // with this PR: back to ok trait_bound::<T>(); } ``` r? `@rust-lang/types`
2024-07-10Rollup merge of #127564 - m-ou-se:review-rotation, r=joboetMatthias Krüger-1/+0
Temporarily remove me from review rotation.
2024-07-10Rollup merge of #127554 - ferrocene:tshepang-add-missing-attribute, ↵Matthias Krüger-0/+1
r=pietroalbini do not run test where it cannot run This was seen on Ferrocene, where we have a custom test target that does not have unwind support
2024-07-10Rollup merge of #127094 - Borgerr:E0191-suggestion-correction, r=fmeaseMatthias Krüger-4/+47
E0191 suggestion correction, inserts turbofish closes #91997
2024-07-10Rollup merge of #126476 - ferrocene:pa-bootstrap-test-local-rustc, r=onur-ozkanMatthias Krüger-2/+44
Fix running bootstrap tests with a local Rust toolchain as the stage0 When configuring a local Rust toolchain as the stage0 (with `build.rustc` and `build.cargo` in `config.toml`) we noticed there were test failures (both on the Python and the Rust side) due to bootstrap not being able to find rustc and Cargo. This was due to those two `config.toml` settings not being propagated in the tests. This PR fixes the issue by ensuring rustc and cargo are always configured in tests, using the parent bootstrap's `initial_rustc` and `initial_cargo`. try-job: x86_64-msvc Fixes https://github.com/rust-lang/rust/issues/105766
2024-07-10simplify and future-proof `needs_normalization`lcnr-13/+10
2024-07-10Auto merge of #127566 - GuillaumeGomez:sync-cg_gcc, r=GuillaumeGomezbors-1138/+2681
Sync rustc_codegen_gcc Follow-up of https://github.com/rust-lang/rustc_codegen_gcc/pull/535. cc `@antoyo`
2024-07-10Fix local download of Docker cachesJakub Beránek-1/+1
2024-07-10instantiate higher ranked goals in candidate selectionlcnr-299/+121
reverts #119820
2024-07-10Update GCC versionGuillaume Gomez-1/+1
2024-07-10Auto merge of #126690 - andyolivares:feature/show_window, r=dtolnaybors-0/+23
Exposing STARTUPINFOW.wShowWindow in CommandExt trait Hi: I needed a way to control how a new process's window is displayed in Windows (normal, minimized, maximized, etc). I noticed that there is no direct way to do that (I even searched for crates doing this, but didn't find any). Inspecting the standard library source code, I figured that it would be a good addition to CommandExt trait that allows some Windows specific customization to a Command. This is my first time contributing to Rust, so please bear with me if I'm not following the rules :)
2024-07-10Update `Cargo.lock` and remove duplicated implGuillaume Gomez-10/+6
2024-07-10Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into masterGuillaume Gomez-1137/+2684
2024-07-10Auto merge of #17572 - beetrees:f16-f128, r=Veykrilbors-73/+384
Add `f16` and `f128` support Adds `f16` and `f128` support, using the `rustc_apfloat` library (also used by `rustc`) for parsing/arithmetic/displaying since the types aren't stable yet so can't be used by rust-analyzer itself. Issue: #17451
2024-07-10Temporarily remove me from review rotation.Mara Bos-1/+0
2024-07-10Auto merge of #17544 - MikeWalrus:inlay-hint-generic-param-name, r=Veykrilbors-14/+430
feat: add inlay hints for generic parameters fixes #11091 By default, only hints for const generic parameters are shown, and this can be configured through `rust-analyzer.inlayHints.genericParameterHints.enable`. Probably needs more testing.