Commit graph

624 commits

Author SHA1 Message Date
Lukas Wirth
e8c4007cfc Fix builtin line! expansion 2023-11-15 14:06:10 +01:00
Laurențiu Nicola
6b53c09ef5 Merge branch 'master' into sync-from-rust 2023-11-15 09:46:27 +02:00
Laurențiu Nicola
610eafe009 Merge commit '76633199f4316b9c659d4ec0c102774d693cd940' into sync-from-rust 2023-11-15 09:45:17 +02:00
Lukas Wirth
e21d21a8fb Diagnose incorrect unsafety for trait impls 2023-11-14 21:05:27 +01:00
Lukas Wirth
e844784d8d Simplify 2023-11-14 12:53:14 +01:00
Lukas Wirth
74e5444f15 Fix some FIXMEs 2023-11-11 15:49:57 +01:00
Lukas Wirth
ba61766217 Add config for preferring / ignoring prelude modules in find_path 2023-11-11 14:56:38 +01:00
Lukas Wirth
801a887954 Record all import paths per item in ImportMap 2023-11-11 14:48:44 +01:00
Lukas Wirth
2339ba4440 Prepare ImportMap for supportin multiple import paths per item 2023-11-11 14:04:24 +01:00
Laurențiu Nicola
d1d111d09e Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra 2023-11-08 08:15:03 +02:00
hkalbasi
1086b294c2 update rustc dependencies 2023-11-08 01:16:47 +03:30
Nicholas Nethercote
6eaf3f8bb2 Remove support for compiler plugins.
They've been deprecated for four years.

This commit includes the following changes.
- It eliminates the `rustc_plugin_impl` crate.
- It changes the language used for lints in
  `compiler/rustc_driver_impl/src/lib.rs` and
  `compiler/rustc_lint/src/context.rs`. External lints are now called
  "loaded" lints, rather than "plugins" to avoid confusion with the old
  plugins. This only has a tiny effect on the output of `-W help`.
- E0457 and E0498 are no longer used.
- E0463 is narrowed, now only relating to unfound crates, not plugins.
- The `plugin` feature was moved from "active" to "removed".
- It removes the entire plugins chapter from the unstable book.
- It removes quite a few tests, mostly all of those in
  `tests/ui-fulldeps/plugin/`.

Closes #29597.
2023-11-04 08:50:46 +11:00
bors
bd38871a98 Auto merge of #15736 - rmehri01:15678_module_incorrect_case_diagnostics, r=HKalbasi
fix: add incorrect case diagnostics for module names

Adds diagnostics for checking both inline and file module names are snake case.

Closes #15678
2023-10-20 16:20:40 +00:00
Lukas Wirth
40acc5250f Update rustc_abi dependency 2023-10-15 18:57:40 +02:00
Ryan Mehri
36eac9abee fix: add incorrect case diagnostics for module names 2023-10-09 13:36:39 -07:00
bors
aaa1e8e1b8 Auto merge of #15618 - shogo-nakano-desu:internal/port-anymap, r=Veykril
internal: port anymap

## Description
- The anymap crate has been ported. During this process, unnecessary features for rust-analyzer have been removed.
- From the tests that were checking the existing licenses, the anymap license (`BlueOak-1.0.0 OR MIT OR Apache-2.0`) has been removed.

## Requests
- While porting the code this time, I have tried to respect the original author's intentions and have kept the comments/codes as much as possible. Please don't hesitate to tell me if you think the comments/codes also need to be appropriately modified.
- If there are any necessary changes regarding the licensing or anything else, please let me know so I can fix them.

## Issue
https://github.com/rust-lang/rust-analyzer/issues/15500
2023-10-09 08:40:54 +00:00
bors
dca63d1b21 Auto merge of #15713 - Veykril:flyimport-completions-short, r=Veykril
Do flyimport completions by prefix search for short paths

Fixes https://github.com/rust-lang/rust-analyzer/issues/15711
2023-10-09 07:56:02 +00:00
Lukas Wirth
88a00bf49d Shrink PatPtr by swapping its AstPtr and Either wrap order 2023-10-06 12:32:37 +02:00
Lukas Wirth
4af730eb26 Do flyimport completions by prefix search for short paths 2023-10-05 13:21:12 +02:00
Lukas Wirth
fe398163b6 Recognize custom main function as binary entrypoint for runnables 2023-10-04 12:07:41 +02:00
Lukas Wirth
2b9dde14ab Allocate ast ids for parameters 2023-09-28 13:16:11 +02:00
bors
4a8622c8fa Auto merge of #15652 - Veykril:format_to, r=lnicola
minor: Various small fixes
2023-09-22 09:06:06 +00:00
Lukas Wirth
556f0c6704 Various small fixes 2023-09-22 10:13:51 +02:00
shogo-nakano-desu
f671b0b864 refactor: move implementation inside anymap crate into stdx crate 2023-09-20 09:02:10 +09:00
shogo-nakano-desu
4b3257a365 refactor: port anymap 2023-09-20 09:02:05 +09:00
bors
22b18b9f77 Auto merge of #15616 - HKalbasi:rustc-deps, r=HKalbasi
Switch to in-tree rustc dependencies with a cfg flag

We can use this flag to detect and prevent breakages in rustc CI. (see #14846 and #15569)

~The `IN_RUSTC_REPOSITORY` is just a placeholder. Is there any existing cfg flag that rustc CI sets?~
2023-09-19 17:41:12 +00:00
Laurențiu Nicola
bcfc997eac Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-from-ra 2023-09-18 12:33:49 +03:00
Laurențiu Nicola
d39b45a58d Merge branch 'master' into sync-from-rust 2023-09-18 12:04:59 +03:00
hkalbasi
f4704bc8ae Switch to in-tree rustc dependencies with a cfg flag 2023-09-15 18:10:11 +03:30
Lukas Wirth
e63e323823 Prefer stable paths over unstable ones in import path calculation 2023-09-14 11:03:41 +02:00
Lukas Wirth
cfcef69072 shrink_to_fit body source map 2023-09-09 14:40:56 +02:00
Lukas Wirth
8f5fee4a5a Diagnose incorrect and private fields in record structs 2023-09-09 10:45:29 +02:00
Lukas Wirth
55c75450fb Diagnose private fields in record constructor 2023-09-08 23:19:30 +02:00
Andy Caldwell
7e786ea4cf Rework no_coverage to coverage(off) 2023-09-08 12:46:06 +01:00
Lukas Wirth
10b0cd7047 Replace format-args parser with upstream fork 2023-09-07 11:37:59 +02:00
bors
f29867bd26 Auto merge of #15559 - Veykril:builtin-format-args, r=Veykril
Implement builtin#format_args, using rustc's format_args parser

`format_args!` now expands to `builtin#format_args(template, args...)`, the actual expansion now instead happens in lowering where we desugar this expression by using lang paths.

As a bonus, we no longer need to evaluate `format_args` as an eager macro which means less macro expansions overall -> less cache thrashing!

Fixes https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-06 17:44:33 +00:00
Lukas Wirth
96f19231d3 Fix hir pretty printing emitting trailing whitespace 2023-09-06 19:31:48 +02:00
Lukas Wirth
5046889f43 Don't allocate the format_args template string as an expression 2023-09-06 19:18:12 +02:00
Lukas Wirth
c0e402637e Emit builtin#format_args in builtin format_args expander 2023-09-06 18:08:20 +02:00
Lukas Wirth
5fdd1e36e3 Remove todo!()s 2023-09-06 15:30:44 +02:00
Lukas Wirth
e243a03da1 Desugar builtin#format_args 2023-09-06 15:21:41 +02:00
Lukas Wirth
abe8f1ece4 Implement builtin#format_args, using rustc's format_args parser 2023-09-05 19:19:46 +02:00
bors
caeea45999 Auto merge of #15557 - Veykril:builtin-syntax, r=Veykril
Parse builtin# syntax and add typechecking for builtin#offset_of expression

Also removes box syntax, fixes https://github.com/rust-lang/rust-analyzer/issues/14504

cc https://github.com/rust-lang/compiler-team/issues/580 https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-05 12:10:31 +00:00
Lukas Wirth
3431d586e5 Insert builtin#asm into asm! expansion 2023-09-05 14:00:49 +02:00
Lukas Wirth
15048304e3 Implement offset_of in hir-def and hir-ty 2023-09-05 12:27:52 +02:00
Lukas Wirth
9b8eb807a3 Parse builtin# syntax 2023-09-05 10:36:35 +02:00
bors
99686d56a8 Auto merge of #15551 - Veykril:docs, r=Veykril
Move doc comment handling into ide-db
2023-09-02 15:28:07 +00:00
Lukas Wirth
81f0108067 Remove markdown module from rust-analyzer crate 2023-09-02 17:27:52 +02:00
Lukas Wirth
b1575528c0 Move doc comment handling into ide-db 2023-09-02 16:27:26 +02:00
cui fliter
056b6b9416 remove the repetitive word
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-09-02 14:18:10 +08:00