Commit Graph

14695 Commits

Author SHA1 Message Date
bors[bot]
b8e1d09b90
Merge #11806
11806: fix: Fix async block type inference using containing function return type r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11804
Should fix https://github.com/rust-analyzer/rust-analyzer/issues/11798#issuecomment-1076880521

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-23 22:45:44 +00:00
Lukas Wirth
ed0c62597f fix: Fix async block type inference using containing function return type 2022-03-23 23:43:04 +01:00
bors[bot]
15fdb95183
Merge #11802
11802: fix: add stubs to make proc macros work that use the `SourceFile` API r=jonas-schievink a=jonas-schievink

Helps with the rocket 0.4 macros, at least on some Rust versions.

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-23 20:58:45 +00:00
bors[bot]
75fada4aab
Merge #11805
11805: fix: Don't try to resolve methods on unknown types r=Veykril a=flodiebold

Fixes #10454, and some type mismatches.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-23 20:20:09 +00:00
Florian Diebold
e0e6bfb924 Fix filter_map in minicore 2022-03-23 19:47:11 +01:00
Florian Diebold
fa923f9b19 Adjust value in syntax highlighting benchmark 2022-03-23 19:28:01 +01:00
Florian Diebold
8d98f3c983 Don't try to resolve methods on unknown types
Fixes #10454, and some type mismatches.
2022-03-23 19:18:12 +01:00
Jonas Schievink
ef8365b1ae Stub out SourceFile related proc macro functions 2022-03-23 16:11:05 +01:00
Jonas Schievink
1e2a4c1bdb Return the first span from Span::join 2022-03-23 15:09:39 +01:00
Jonas Schievink
18ad750786 fix: properly import all types of macros with #[macro_use] again 2022-03-23 14:34:27 +01:00
Waffle Maybe
c8762a17fd
Fix typo in abi_1_57/mod.rs comment 2022-03-23 16:48:25 +04:00
Jonas Schievink
40856f01a1 Introduce new fixed proc macro ABI for 1.57.0 2022-03-23 12:20:00 +01:00
bors[bot]
652233283b
Merge #11791
11791: fix: some fixes and improvements to signature help r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-23 00:36:11 +00:00
bors[bot]
c2ea378920
Merge #11795
11795: fix: Correctly suggest auto importing traits from aliases r=Veykril a=unexge

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

Co-authored-by: unexge <unexge@gmail.com>
2022-03-22 21:44:06 +00:00
unexge
4e4c9ea4ac fix: Correctly suggest auto importing traits from aliases 2022-03-22 22:30:29 +01:00
bors[bot]
1a92ee5db5
Merge #11792
11792: minor: Bump dependencies r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-22 21:00:24 +00:00
Lukas Wirth
8e91bb7660 minor: Bump dependencies 2022-03-22 17:42:24 +01:00
Jonas Schievink
4e07864f59 signature help: skip lifetimes when non-lifetime arguments are present 2022-03-22 16:44:27 +01:00
bors[bot]
f1dbc2acd4
Merge #11789
11789: fix: Fix lifetime elision hint configuration key r=Veykril a=Veykril

This is inconsistent with the other configuration keys unfortunately, but this is an issue of how we structured them here in general.

I feel like we'll have to do a proper pass over all the configs, check them for consistency and then write down some documentation of how our configs should be laid out, then apply fixes to the inconsistencies all at once which will entail breaking some user configurations unfortunately since we won't be able to do proper fallback handling for some of these.

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

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-22 15:31:45 +00:00
Lukas Wirth
ecf2c98859 fix: Fix lifetime elision hint configuration key 2022-03-22 16:28:36 +01:00
bors[bot]
800ae516db
Merge #11788
11788: internal: Improve `find_path` and extern prelude handling r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-22 15:17:50 +00:00
Jonas Schievink
b7cc9a7275 Trigger call info when completing generic type
Closes #11763
2022-03-22 16:10:17 +01:00
Jonas Schievink
4bb5df0ce5 Avoid signature help inside multiline expressions
Fixes #11768
2022-03-22 16:08:46 +01:00
bors[bot]
98d1724cb0
Merge #11786
11786: fix: fill_match_arms doesn't add wildcard pat for local enums r=Veykril a=OleStrohm

Fix #11783 

This adds similar logic to non_exhaustive as is currently on doc(hidden)

Co-authored-by: Ole Strohm <strohm99@gmail.com>
2022-03-22 14:58:17 +00:00
Lukas Wirth
cb1b7e18fe internal: Improve find_path and extern prelude handling 2022-03-22 15:54:46 +01:00
Jonas Schievink
c9cefb9916 Improve readability of signature help tests 2022-03-22 15:03:19 +01:00
Ole Strohm
b3bd547dda applied rustfmt 2022-03-22 11:10:48 +00:00
Ole Strohm
94113b0ac6 fix: fill_match_arms doesn't add wildcard pat for local enums 2022-03-22 10:56:20 +00:00
bors[bot]
5d2cd18765
Merge #11780
11780: feat: Add type mismatch diagnostic r=flodiebold a=flodiebold

This adds a proper diagnostic for type mismatches, turning "Add reference here", "Missing Ok or Some" and "Remove this semicolon" into quickfixes for this single diagnostic.
The diagnostic is marked as experimental when it does not have one of these quickfixes, so it can be turned off with `rust-analyzer.diagnostics.enableExperimental` (or specifically with `rust-analyzer.diagnostics.disabled` of course, the ID is `type-mismatch`).
There will still be some false positives, but I think there shouldn't be too many especially when the Chalk fix lands, and it's still experimental anyway 🙂 
This also fixes type checking for `rustc_legacy_const_generics` just to avoid some errors in tests.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-22 10:40:23 +00:00
Lukas Wirth
000e681d5f fix: Fix tuple- and record struct completions not working with existing braces 2022-03-21 22:01:26 +01:00
Lukas Wirth
7370a6b5b8 fix: Fix flyimport showing functions in pattern position 2022-03-21 19:41:39 +01:00
Florian Diebold
3bdb68d80f Clean up commented-out lines 2022-03-21 19:16:58 +01:00
Florian Diebold
5f24ff0d84 Fix unreachable_pub 2022-03-21 18:54:20 +01:00
Florian Diebold
344cf1db5f Fix expect 2022-03-21 17:00:03 +01:00
Florian Diebold
baa43a86ab Add a FIXME 2022-03-21 16:49:01 +01:00
Florian Diebold
8498eaa6ab Implement type checking for legacy_const_generics 2022-03-21 16:46:01 +01:00
Florian Diebold
2ef541b35f Cleanups 2022-03-21 16:46:01 +01:00
Florian Diebold
b632d706c7 Remove old diagnostics 2022-03-21 16:46:01 +01:00
Florian Diebold
a49a0ab883 Add 'remove this semicolon' 2022-03-21 16:46:01 +01:00
Florian Diebold
0689fdb650 Add "add missing Ok/Some" fix 2022-03-21 16:46:01 +01:00
Florian Diebold
ab3313b1cb Add new type-mismatch diagnostic 2022-03-21 16:46:01 +01:00
Florian Diebold
2d30dd67d3 Expose coercion logic in hir API 2022-03-21 16:45:59 +01:00
Florian Diebold
6133e6a002 Extract coercion logic to InferenceTable
To make it accessible without an InferenceContext.
2022-03-21 16:45:30 +01:00
Laurențiu Nicola
1a37b17162 Replace write! with direct calls 2022-03-21 10:43:36 +02:00
bors[bot]
b594f9c441
Merge #11690
11690: feat: Add an assist for inlining type aliases r=Veykril a=steven-joruk

I'm working towards implementing #10881, but I'd like to get this in first with earlier feedback.

Is `inline_type_alias` a good enough name? I guess the follow up assist would be called `inline_type_alias_into_all_users` based on that.

![valid_inlines](https://user-images.githubusercontent.com/1277939/158020510-fed78b5c-4c7e-46d1-9151-3044a29b9990.gif)

![invalid_inlines](https://user-images.githubusercontent.com/1277939/158020516-8a2deb6d-c6ec-4adf-a15b-c514fc97dc43.gif)



Co-authored-by: Steven Joruk <steven@joruk.com>
2022-03-20 21:15:49 +00:00
Steven Joruk
1381a2de23 refactor: Do more work in inline_type_alias closure 2022-03-20 20:53:03 +00:00
bors[bot]
6f2b118605
Merge #11775
11775: internal: Treat `global_asm` and `asm` macros as unsafe r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:31:27 +00:00
Lukas Wirth
ddf144051a internal: Treat {global_}asm macros as unsafe 2022-03-20 19:31:00 +01:00
bors[bot]
fedf724d82
Merge #11774
11774: feat: Tag macro calls as unsafe if they expand to unsafe expressions r=Veykril a=Veykril

as long as they aren't inside an unsafe block inside the macro that is.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:15:29 +00:00
Lukas Wirth
3b7b223b25 Simplify 2022-03-20 19:13:50 +01:00