Commit Graph

13631 Commits

Author SHA1 Message Date
Jonas Schievink
869ad13cf1 Don't respawn proc macro server on crash 2020-12-04 20:11:56 +01:00
bors[bot]
b6def6575c
Merge #6724
6724: Fix `diagnostics` subcommand, look at all modules r=jonas-schievink a=jonas-schievink

The `diagnostics` subcommand used to only compute diagnostics for `lib.rs` / the root module of all workspace crates. This fixed it and makes it look at every module.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-04 18:39:04 +00:00
Jonas Schievink
e45ab7e0ec Fix diagnostics subcommand, look at all modules 2020-12-04 19:37:37 +01:00
bors[bot]
7efab3ed03
Merge #6723
6723: Use correct, full substs for self type in impl r=flodiebold a=flodiebold

Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't a problem; but with arbitrary self types, it can.

This fixes the crash from #6668; but it doesn't make method resolution work for these methods.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-12-04 17:44:37 +00:00
Florian Diebold
e5fd550dfd Use correct, full substs for self type in impl
Without arbitrary self types, the self type could never refer to the method type
parameters, so this wasn't a problem; but with arbitrary self types, it can.

This fixes the crash from #6668; but it doesn't make method resolution work for
these methods.
2020-12-04 18:43:47 +01:00
bors[bot]
6943b53023
Merge #6722
6722: Minor proc macro cleanups r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-04 17:09:12 +00:00
Jonas Schievink
b857149720 Unwrap process.stdio() result
If this is ever `None` here, that's a bug
2020-12-04 14:03:06 +01:00
Jonas Schievink
2845ce5bc6 Destructure in for loop 2020-12-04 13:57:33 +01:00
Jonas Schievink
c50d9f3683 Remove unnecessary Option 2020-12-04 13:54:09 +01:00
bors[bot]
b988c6f84e
Merge #6715
6715: Don't diagnose `#[cfg]` in macros r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6363

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-03 19:47:00 +00:00
Jonas Schievink
6e1c87eb92 Don't diagnose #[cfg] in macros 2020-12-03 20:46:16 +01:00
bors[bot]
070ecef249
Merge #6713
6713: Make `compile_error!` message match upstream rustc r=jonas-schievink a=jonas-schievink

It only consists of the argument passed to it.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-03 18:08:17 +00:00
Jonas Schievink
957fb18799 Make compile_error! message match upstream rustc
It only consists of the argument passed to it
2020-12-03 19:07:37 +01:00
bors[bot]
ec2bdd3c16
Merge #6712
6712: Fix proc macro token mapping r=jonas-schievink a=jonas-schievink

Diagnostics inside proc macros are currently incorrectly placed at their original offset, but inside the containing file. This fixes that, by allowing the creation of `ExpansionInfo` from non-`macro_rules!` macro invocations.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-03 17:40:18 +00:00
Jonas Schievink
3e6ffa5124 Fix proc macro token mapping 2020-12-03 18:38:05 +01:00
bors[bot]
d46fce88f5
Merge #6700
6700: More macro diagnostics improvements r=jonas-schievink a=jonas-schievink

This threads macro expansion errors through `eager.rs` and the `AsMacroCall` trait, improving macro diagnostics emitted during body lowering.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-03 16:55:15 +00:00
Jonas Schievink
bca1e5fcb8 Rename error_sink to diagnostic_sink 2020-12-03 17:54:43 +01:00
bors[bot]
74de29b223
Merge #6711
6711: cargo update: bump libloading to fix a double-free r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-12-03 15:31:36 +00:00
kjeremy
1da8726b85 cargo update: bump libloading to fix a double-free 2020-12-03 10:30:28 -05:00
bors[bot]
1d1da5ea8c
Merge #6710
6710: Extract tests module to file in ide_db crate r=matklad a=sasurau4

Helps with #6522 

- pass `cargo test`

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
2020-12-03 15:13:55 +00:00
Aleksey Kladov
3e00bfce2b Document statelessness invariant 2020-12-03 18:08:27 +03:00
Daiki Ihara
f486640682 Extract tests module to file in ide_db crate 2020-12-04 00:05:39 +09:00
Jonas Schievink
883c8d177d Make compile_error! lazy and emit a diagnostic 2020-12-03 15:48:29 +01:00
Jonas Schievink
4634bfb332 Give better diagnostic if OUT_DIR is unset 2020-12-03 15:48:29 +01:00
Jonas Schievink
17542d08b4 Update/Fix tests 2020-12-03 15:48:29 +01:00
Jonas Schievink
a634243634 Propagate eager expansion errors 2020-12-03 15:48:29 +01:00
bors[bot]
5a1306a436
Merge #6702
6702: Bump mio for safety goodness r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-12-02 21:07:28 +00:00
kjeremy
75bd5a5e20 Bump mio for safety goodness 2020-12-02 16:06:36 -05:00
bors[bot]
de9a984cbe
Merge #6701
6701: Don't prime caches when just opening a file r=jonas-schievink a=jonas-schievink

Fixes occasional "progress handler already registered" errors.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-02 19:19:19 +00:00
Jonas Schievink
6da651f5da Don't prime caches when just opening a file 2020-12-02 20:18:28 +01:00
bors[bot]
a3043cf53f
Merge #6699
6699: Test macro diagnostics in body lowering r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-02 14:03:57 +00:00
Jonas Schievink
f4866bb05c Test macro diagnostics in body lowering 2020-12-02 15:03:21 +01:00
bors[bot]
3e1fb112af
Merge #6698
6698: Attach macro expansion errors to the right file r=jonas-schievink a=jonas-schievink

Previously it attached them to the result of the macro expansion (or, if no result was produced, to the file containing the invocation). Always use the file containing the invocation.

This doesn't seem to have any observable difference, but seems better in theory.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-02 13:25:54 +00:00
Jonas Schievink
319fcd01ac Attach macro expansion errors to the right file 2020-12-02 14:23:51 +01:00
bors[bot]
dc09d97fb2
Merge #6649
6649: Accept more than just the standard rust literal suffixes in *Number::suffix r=matklad a=Veykril

I am not entirely sure whether to keep or remove the `SUFFIXES` but I figured we can always bring them back once they are needed.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 13:13:01 +00:00
bors[bot]
1db60512b6
Merge #6673
6673: Show type of Self on hover r=matklad a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 13:06:34 +00:00
bors[bot]
a8f04712d6
Merge #6679
6679: Extract tests module to file in vfs crate r=matklad a=sasurau4

Helps with #6522 

- [x] passed `cargo test`

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
2020-12-02 12:34:19 +00:00
bors[bot]
14086e3118
Merge #6697
6697: Don't discard PathKind::Abs information in lower_use::convert_path r=matklad a=Veykril

Fixes #6694

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-12-02 12:16:19 +00:00
Lukas Wirth
7b456552b8 Don't discard PathKind::Abs information in lower_use::convert_path 2020-12-02 09:54:03 +01:00
bors[bot]
bb697727a2
Merge #6690
6690: lsp-types 0.85: Fixes OptionalVersionedTextDocumentIdentifier specification r=kjeremy a=kjeremy

Fixes #6654

Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-12-01 13:36:02 +00:00
kjeremy
e4ffd70c91 Fix OptionalVersionedTextDocumentIdentifier type
Fixes #6654
2020-12-01 08:33:21 -05:00
bors[bot]
a18392bd90
Merge #6689
6689: Trigger .let postfix snippet in the middle of the block r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-01 12:38:45 +00:00
Aleksey Kladov
21d962f0ac Trigger .let postfix snippet in the middle of the block 2020-12-01 15:38:06 +03:00
bors[bot]
eb7f969510
Merge #6683
6683: Emit macro diagnostics when lowering bodies r=matklad a=jonas-schievink

Changes `Expander::enter_expand` to return an `ExpandResult`, and adds any contained errors to the body diagnostic list.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-01 12:27:52 +00:00
Jonas Schievink
ea7b81fef9 Emit unresolved proc macro errors 2020-12-01 12:40:03 +01:00
bors[bot]
75e037fcf7
Merge #6688
6688: Place cursor correctly when completing assoc fns with self r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-12-01 11:29:25 +00:00
Aleksey Kladov
9d94ffad44 Place cursor correctly when completing assoc fns with self 2020-12-01 14:28:50 +03:00
Aleksey Kladov
02955661a0 Fix typo 2020-12-01 13:56:46 +03:00
Aleksey Kladov
6f51f728a1 Type-safer API for dealing with parameter lists with optional self 2020-12-01 13:53:39 +03:00
Jonas Schievink
be50908a50 Emit macro diagnostics when lowering bodies 2020-11-30 20:26:35 +01:00