Commit graph

260856 commits

Author SHA1 Message Date
Lukas Wirth
afa72d53e3
Keep references in format! when the target is unsized 2024-07-20 08:39:04 +02:00
Yuri Astrakhan
2a8cc1db3a Avoid ref when using format! in compiler
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-19 14:41:59 -04:00
bors
95c48af734 Auto merge of #17638 - Veykril:salsa-perf, r=Veykril
perf: Reduce memory usage of salsa slots by 8 bytes
2024-07-19 15:48:57 +00:00
Lukas Wirth
091dc26cda perf: Reduce memory usage of salsa slots by 8 bytes 2024-07-19 17:34:48 +02:00
bors
a75b6faa9e Auto merge of #17637 - jjoeldaniel:master, r=Veykril
internal: remove rust-analyzer.openFAQ

Removed no longer functional `rust-analyzer.openFAQ` command created in #17508
2024-07-19 15:34:43 +00:00
bors
d16acea62c Auto merge of #17622 - roife:fix-issue-17602, r=Veykril
fix: handle synonymous imports with different renaming in 'merge imports'

fix #17602
2024-07-19 15:16:02 +00:00
Joel Daniel Rico
346210bb1b remove rust-analyzer.openFAQ 2024-07-19 08:11:16 -07:00
bors
fd240c00e0 Auto merge of #17620 - Veykril:edition-aware-parser, r=Veykril
Edition aware parser

Fixes https://github.com/rust-lang/rust-analyzer/issues/16324 by allowing us to properly thread through the edition to the parser
2024-07-19 14:56:56 +00:00
Lukas Wirth
754f53ca1a Test macros doing edition dependent parsing 2024-07-19 16:43:58 +02:00
Lukas Wirth
62eba06591 Prevent generated runner module from being format checked 2024-07-19 16:01:47 +02:00
Lukas Wirth
2dc84abb55 Parse try as a keyword only in edition 2018 and up 2024-07-19 15:43:20 +02:00
Lukas Wirth
f4b2bf5c53 Add basic edition inline parser test support 2024-07-19 15:19:43 +02:00
bors
e6e8bd299d Auto merge of #17634 - lnicola:fix-xtask-install, r=lnicola
minor: Make xtask install work again

CC https://github.com/rust-lang/rust-analyzer/pull/17559#issuecomment-2234052939
2024-07-19 06:15:00 +00:00
Laurențiu Nicola
6fa6d2081a Make xtask install work again 2024-07-19 09:11:26 +03:00
bors
40730a4baf Auto merge of #17246 - davidbarsky:david/move-rust-project-generation-to-server, r=Veykril
feature: teach rust-analyzer to discover `linked_projects`

This PR's been a long-time coming, but like the title says, it introduces server-side project discovery and removes the extension hooks I previously introduced. I don't think this PR is ready to land, but here are the things I'm feeling squishy about:
- I don't think I like the idea of introducing the `cargo-metadata` command-but-for-everything-else in the `flycheck` module, but the progress reporting infrastructure was too convenient to pass up. Happy to move it elsewhere.

Here are the things I _know_ I need to change:
- For progress reporting, I'm extracting from a `serde_json::Value` that corresponds to `tracing_subsciber::fmt::Layer`'s JSON output. I'd like to make this a bit more structured/documented than the current nonsense I wrote.
- The progress reporting currently hardcodes "Buck"; it should be deriving that from the previously mentioned more-structured-output.
- This doesn't handle *reloading* when a corresponding buildfile is changed. It should be doing that.

<details>
<summary>Anyway, here's a video of rust-analyzer discovering a Buck target.</summary>

https://github.com/rust-lang/rust-analyzer/assets/2067774/be6cd9b9-2c9a-402d-847f-05f860a91df1
</details>
2024-07-18 16:15:31 +00:00
David Barsky
2e582ad848 feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
Lukas Wirth
eae705e5ed Rewrite inline parser test infra to generated proper rust test cases 2024-07-18 10:03:19 +02:00
Lukas Wirth
736723d435 Update test fixtures 2024-07-18 09:09:31 +02:00
Lukas Wirth
20e27b874d Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
roife
9dcd4ba0ef fix: handle synonymous imports in 'merge imports' 2024-07-18 05:01:58 +08:00
bors
020b7acd6a Auto merge of #17618 - Veykril:rustc_skip_during_method_dispatch, r=Veykril
Support rustc_skip_during_method_dispatch

Fixes https://github.com/rust-lang/rust-analyzer/issues/17256
2024-07-17 09:48:18 +00:00
Lukas Wirth
835734eed0 Support rustc_skip_during_method_dispatch 2024-07-17 11:46:36 +02:00
bors
0401e1c52a Auto merge of #17617 - Veykril:grammar-kind-gen, r=Veykril
Derive kinds information from ungrammar file

This reduces the need to touch more files when adding a new grammar rule
2024-07-17 09:27:03 +00:00
Lukas Wirth
f7516d95a7 string is not a keyword 2024-07-17 11:11:57 +02:00
Lukas Wirth
0bffb1345b Add always disabled gen parse support 2024-07-17 10:49:12 +02:00
Lukas Wirth
373e84fb28 Derive kinds information from ungrammar file 2024-07-17 10:04:45 +02:00
bors
d95ce94543 Auto merge of #17616 - Veykril:config-param-hints, r=Veykril
Fix incorrect generic parameter hint defaults

Missed this in the review but we should show const param hints, not lifetime param hints by default
2024-07-17 06:54:06 +00:00
Lukas Wirth
7ef5f46c83 Fix incorrect generic parameter hint defaults 2024-07-17 08:52:23 +02:00
bors
523465a677 Auto merge of #17614 - lnicola:build-scripts-override-docs, r=lnicola
minor: Add --keep-going to the `cargo.buildScripts.overrideCommand` docs

CC https://github.com/rust-lang/rust-analyzer/issues/17608#issuecomment-2231949548
2024-07-17 05:45:18 +00:00
Laurențiu Nicola
f0b8055164 Add --keep-going to rust-analyzer.cargo.buildScripts.overrideCommand docs 2024-07-17 08:42:39 +03:00
bors
2a8b4a2000 Auto merge of #17611 - Veykril:macro-arg-no-call, r=Veykril
fix: Don't call macro_arg directly in `ExpandDatabase::syntax_context`
2024-07-16 20:12:14 +00:00
Lukas Wirth
811ce15b12 Don't call macro_arg directly in ExpandDatabase::syntax_context 2024-07-16 22:10:42 +02:00
bors
216bef36bc Auto merge of #17609 - lnicola:sync-from-rust, r=lnicola
minor: Sync from downstream
2024-07-16 13:38:39 +00:00
Laurențiu Nicola
137c736d66 Merge from rust-lang/rust 2024-07-16 16:23:47 +03:00
Augie Fackler
72e22554ca cleanup: remove support for 3DNow! cpu features
In llvm/llvm-project@f0eb5587ce all
support for 3DNow! intrinsics and instructions were removed. Per the commit message
there, only AMD chips between 1998 and 2011 or so actually supported
these instructions, and they were effectively replaced by SSE which was
available on many more chips. I'd be very surprised if anyone had ever
used these from Rust.
2024-07-17 11:45:02 -04:00
Laurențiu Nicola
2e37675cc9 Preparing for merge from rust-lang/rust 2024-07-16 16:23:33 +03:00
bors
e5b1a2b3cd Auto merge of #17605 - Veykril:runnable-sysroot, r=Veykril
Set `RUSTC_TOOLCHAIN` for runnables

With this the client doesn't necessarily need to guess the sysroot anymore
2024-07-16 11:49:27 +00:00
Lukas Wirth
4f031d9768 Set RUSTC_SYSROOT for runnables 2024-07-16 13:48:14 +02:00
bors
064e6ed163 Auto merge of #17604 - Veykril:tt-symbols, r=Veykril
More symbol usage
2024-07-16 11:04:14 +00:00
bors
a91f7d72f1 Auto merge of #127617 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2024-07-16 10:54:30 +00:00
Lukas Wirth
41451a26e9 Remove Name::to_smol_str 2024-07-16 12:43:58 +02:00
Lukas Wirth
1a20a0803f More symbol usage 2024-07-16 12:05:16 +02:00
bors
6c10c85838 Auto merge of #17603 - Veykril:tt-symbols, r=Veykril
Switch token trees to use Symbols
2024-07-16 08:42:58 +00:00
Lukas Wirth
9ce066e6fa Use symbol in cfg 2024-07-16 10:41:42 +02:00
bors
5572759b8d Auto merge of #127796 - tgross35:rollup-ubo5hzb, r=tgross35
Rollup of 6 pull requests

Successful merges:

 - #120990 (Suggest a borrow when using dbg)
 - #127047 (fix least significant digits of f128 associated constants)
 - #127709 (match lowering: Move `MatchPair` tree creation to its own module)
 - #127770 (Update books)
 - #127780 (Make sure trait def ids match before zipping args in `note_function_argument_obligation`)
 - #127795 (Fix typos in RELEASES.md)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-16 08:33:11 +00:00
Lukas Wirth
7f8a54bbee Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
Laurențiu Nicola
3e73272ac7 Use re-exported Idx and IndexVec in pat_analysis 2024-07-16 10:41:13 +03:00
Trevor Gross
658a13d2d1
Rollup merge of #127795 - programmerjake:patch-3, r=cuviper
Fix typos in RELEASES.md

as requested in https://github.com/rust-lang/blog.rust-lang.org/pull/1358#discussion_r1678691772

r? `@cuviper`
2024-07-16 02:02:26 -05:00
Trevor Gross
1abed9fa06
Rollup merge of #127780 - compiler-errors:zip-args, r=jieyouxu
Make sure trait def ids match before zipping args in `note_function_argument_obligation`

Fixes #126416
Fixes #127745

Didn't add both tests b/c I felt like it was unnecessary.
2024-07-16 02:02:25 -05:00
Trevor Gross
7f8e0e6ef3
Rollup merge of #127770 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

3 commits in f1e49bf7a8ea6c31ce016a52b8a4f6e1ffcfbc64..67fa536768013d9d5a13f3a06790521d511ef711
2024-07-12 21:21:45 UTC to 2024-07-05 17:35:06 UTC

- Use Rust 2021 Edition for mdBook (rust-lang/book#3974)
- Backport changes to chapter 11 (rust-lang/book#3969)
- Upgrade to Rust 1.79.0 (rust-lang/book#3968)

## rust-lang/edition-guide

2 commits in 941db8b3df45fd46cd87b50a5c86714b91dcde9c..5454de3d12b9ccc6375b629cf7ccda8264640aac
2024-07-14 07:06:34 UTC to 2024-07-12 06:05:29 UTC

- Update timeline etc. for Rust 2024
- 2024: Add note about never_type_fallback_flowing_into_unsafe lint level. (rust-lang/edition-guide#311)

## rust-embedded/book

1 commits in b10c6acaf0f43481f6600e95d4b5013446e29f7a..019f3928d8b939ec71b63722dcc2e46330156441
2024-07-11 17:46:10 UTC to 2024-07-11 17:46:10 UTC

- typo on tooling.md (rust-embedded/book#373)

## rust-lang/reference

9 commits in 1ae3deebc3ac16e276b6558e01420f8e605def08..e2f0bdc4031866734661dcdb548184bde1450baf
2024-06-29 16:59:51 +0000 to 2024-07-15 17:52:44 +0000

- Suppress type length limit test and note that it is not enforced (rust-lang/reference#1527)
- elaborate on slice wide pointer metadata (rust-lang/reference#1499)
- '.inst' in inline-assembly changed to '.insn' (rust-lang/reference#1453)
- Clarify that `asm!` blocks can be duplicated or deduplicated by the compiler (rust-lang/reference#1441)
- Add mdbook-spec (rust-lang/reference#1520)
- Add note about static libraries not linking their dependencies (rust-lang/reference#1472)
- more explicitly explain the UB around immutable extern statics (rust-lang/reference#1502)
- Improvements to `items/functions.md` (rust-lang/reference#1458)
- Enable mdbook smart-punctuation. (rust-lang/reference#1516)

## rust-lang/rust-by-example

1 commits in 658c6c27cb975b92227936024816986c2d3716fb..89aecb6951b77bc746da73df8c9f2b2ceaad494a
2024-07-11 12:33:43 UTC to 2024-07-11 12:33:43 UTC

- Update option_result.md (rust-lang/rust-by-example#1864)

## rust-lang/rustc-dev-guide

6 commits in d6e3a32a557db5902e714604def8015d6bb7e0f7..0c4d55cb59fe440d1a630e4e5774d043968edb3f
2024-07-15 15:16:43 UTC to 2024-07-01 19:05:14 UTC

- Improve documentation of MIR queries & passes (rust-lang/rustc-dev-guide#1434)
- Bump dependencies for date-check tool (rust-lang/rustc-dev-guide#2012)
- Fix typo: lists -> lints (rust-lang/rustc-dev-guide#2011)
- use "bootstrap" instead of "rustbuild" (rust-lang/rustc-dev-guide#2010)
- Fix grammar issue in optimize-build.md (rust-lang/rustc-dev-guide#2009)
- Update name of Fuchsia builder (rust-lang/rustc-dev-guide#2008)
2024-07-16 02:02:25 -05:00