]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11810
bors[bot] [Thu, 24 Mar 2022 17:27:18 +0000 (17:27 +0000)]
Merge #11810

11810: internal: rename the 1.47 proc macro ABI to 1.48 r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/issues/9898.

We don't support 1.47, so rename it to reflect that.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoRename the 1.47 ABI to 1.48
Jonas Schievink [Thu, 24 Mar 2022 17:26:10 +0000 (18:26 +0100)]
Rename the 1.47 ABI to 1.48

2 years agoMerge #11772
bors[bot] [Thu, 24 Mar 2022 09:42:09 +0000 (09:42 +0000)]
Merge #11772

11772: Support constants in const eval r=HKalbasi a=HKalbasi

This PR enables evaluating things like this:
```rust
const X: usize = 2;
const Y: usize = 3 + X; // = 5
```
My target was nalgebra's `U5`, `U22`, ... which are defined as `type U5 = Const<{ SomeType5::SOME_ASSOC_CONST }>` but I didn't find out how to find the `ConstId` of the implementation of the trait, not the trait itself (possibly related to #4558 ? We can find associated type alias, so maybe this is doable already) So it doesn't help for nalgebra currently, but it is useful anyway.

Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2 years agouse pat_id instead of name in const eval stack
hkalbasi [Thu, 24 Mar 2022 09:06:37 +0000 (13:36 +0430)]
use pat_id instead of name in const eval stack

2 years agoorganize const eval tests
hkalbasi [Thu, 24 Mar 2022 08:36:27 +0000 (13:06 +0430)]
organize const eval tests

2 years agoSupport constants in const eval
hkalbasi [Sun, 20 Mar 2022 13:45:28 +0000 (17:15 +0330)]
Support constants in const eval

2 years agoMerge #11806
bors[bot] [Wed, 23 Mar 2022 22:45:44 +0000 (22:45 +0000)]
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>
2 years agofix: Fix async block type inference using containing function return type
Lukas Wirth [Wed, 23 Mar 2022 22:39:35 +0000 (23:39 +0100)]
fix: Fix async block type inference using containing function return type

2 years agoMerge #11802
bors[bot] [Wed, 23 Mar 2022 20:58:45 +0000 (20:58 +0000)]
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>
2 years agoMerge #11805
bors[bot] [Wed, 23 Mar 2022 20:20:09 +0000 (20:20 +0000)]
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>
2 years agoFix filter_map in minicore
Florian Diebold [Wed, 23 Mar 2022 18:47:11 +0000 (19:47 +0100)]
Fix filter_map in minicore

2 years agoAdjust value in syntax highlighting benchmark
Florian Diebold [Wed, 23 Mar 2022 18:28:01 +0000 (19:28 +0100)]
Adjust value in syntax highlighting benchmark

2 years agoDon't try to resolve methods on unknown types
Florian Diebold [Wed, 23 Mar 2022 18:18:12 +0000 (19:18 +0100)]
Don't try to resolve methods on unknown types

Fixes #10454, and some type mismatches.

2 years agoStub out `SourceFile` related proc macro functions
Jonas Schievink [Wed, 23 Mar 2022 15:11:05 +0000 (16:11 +0100)]
Stub out `SourceFile` related proc macro functions

2 years agoMerge #11801
bors[bot] [Wed, 23 Mar 2022 14:11:42 +0000 (14:11 +0000)]
Merge #11801

11801: fix: avoid returning `None` from `Span::join` to fix some proc macros r=jonas-schievink a=jonas-schievink

Some proc macros, notably rocket, `.unwrap()` the result of `Span::join` (and correctly so, it should never be `None`). We don't have a proper implementation of that API, so we always returned `None`. This changes our stub impl to return the first span instead.

Does not fully fix rocket's macros, they need other stuff to work too.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoReturn the first span from `Span::join`
Jonas Schievink [Wed, 23 Mar 2022 14:09:39 +0000 (15:09 +0100)]
Return the first span from `Span::join`

2 years agoMerge #11800
bors[bot] [Wed, 23 Mar 2022 13:34:49 +0000 (13:34 +0000)]
Merge #11800

11800: fix: fix `#[macro_use]` no longer importing non-`macro_rules!` macros r=jonas-schievink a=jonas-schievink

https://github.com/rust-analyzer/rust-analyzer/pull/11663 introduced a regression tracked in https://github.com/rust-analyzer/rust-analyzer/issues/11781, this fixes it.

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

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agofix: properly import all types of macros with #[macro_use] again
Jonas Schievink [Wed, 23 Mar 2022 13:30:04 +0000 (14:30 +0100)]
fix: properly import all types of macros with #[macro_use] again

2 years agoMerge #11799
bors[bot] [Wed, 23 Mar 2022 12:55:48 +0000 (12:55 +0000)]
Merge #11799

11799: minor: Fix typo in `abi_1_57/mod.rs` comment r=lnicola a=WaffleLapkin

Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2 years agoFix typo in `abi_1_57/mod.rs` comment
Waffle Maybe [Wed, 23 Mar 2022 12:48:25 +0000 (16:48 +0400)]
Fix typo in `abi_1_57/mod.rs` comment

2 years agoMerge #11797
bors[bot] [Wed, 23 Mar 2022 11:23:07 +0000 (11:23 +0000)]
Merge #11797

11797: fix: fix "unwrap on a `None` value" in proc macros built with Rust 1.57.0 r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/issues/10570

cc https://github.com/rust-analyzer/rust-analyzer/pull/10769#issuecomment-1076251859

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoIntroduce new fixed proc macro ABI for 1.57.0
Jonas Schievink [Wed, 23 Mar 2022 11:20:00 +0000 (12:20 +0100)]
Introduce new fixed proc macro ABI for 1.57.0

2 years agoMerge #11791
bors[bot] [Wed, 23 Mar 2022 00:36:11 +0000 (00:36 +0000)]
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>
2 years agoMerge #11795
bors[bot] [Tue, 22 Mar 2022 21:44:06 +0000 (21:44 +0000)]
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>
2 years agofix: Correctly suggest auto importing traits from aliases
unexge [Tue, 22 Mar 2022 21:30:29 +0000 (22:30 +0100)]
fix: Correctly suggest auto importing traits from aliases

2 years agoMerge #11792
bors[bot] [Tue, 22 Mar 2022 21:00:24 +0000 (21:00 +0000)]
Merge #11792

11792: minor: Bump dependencies r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Bump dependencies
Lukas Wirth [Tue, 22 Mar 2022 16:36:41 +0000 (17:36 +0100)]
minor: Bump dependencies

2 years agosignature help: skip lifetimes when non-lifetime arguments are present
Jonas Schievink [Tue, 22 Mar 2022 15:44:27 +0000 (16:44 +0100)]
signature help: skip lifetimes when non-lifetime arguments are present

2 years agoMerge #11789
bors[bot] [Tue, 22 Mar 2022 15:31:45 +0000 (15:31 +0000)]
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>
2 years agofix: Fix lifetime elision hint configuration key
Lukas Wirth [Tue, 22 Mar 2022 15:27:59 +0000 (16:27 +0100)]
fix: Fix lifetime elision hint configuration key

2 years agoMerge #11788
bors[bot] [Tue, 22 Mar 2022 15:17:50 +0000 (15:17 +0000)]
Merge #11788

11788: internal: Improve `find_path` and extern prelude handling r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoTrigger call info when completing generic type
Jonas Schievink [Tue, 22 Mar 2022 15:10:17 +0000 (16:10 +0100)]
Trigger call info when completing generic type

Closes #11763

2 years agoAvoid signature help inside multiline expressions
Jonas Schievink [Tue, 22 Mar 2022 15:05:24 +0000 (16:05 +0100)]
Avoid signature help inside multiline expressions

Fixes #11768

2 years agoMerge #11786
bors[bot] [Tue, 22 Mar 2022 14:58:17 +0000 (14:58 +0000)]
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>
2 years agointernal: Improve `find_path` and extern prelude handling
Lukas Wirth [Tue, 22 Mar 2022 14:54:46 +0000 (15:54 +0100)]
internal: Improve `find_path` and extern prelude handling

2 years agoImprove readability of signature help tests
Jonas Schievink [Tue, 22 Mar 2022 14:03:19 +0000 (15:03 +0100)]
Improve readability of signature help tests

2 years agoapplied rustfmt
Ole Strohm [Tue, 22 Mar 2022 11:10:48 +0000 (11:10 +0000)]
applied rustfmt

2 years agofix: fill_match_arms doesn't add wildcard pat for local enums
Ole Strohm [Tue, 22 Mar 2022 10:56:20 +0000 (10:56 +0000)]
fix: fill_match_arms doesn't add wildcard pat for local enums

2 years agoMerge #11780
bors[bot] [Tue, 22 Mar 2022 10:40:23 +0000 (10:40 +0000)]
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 :slightly_smiling_face:
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>
2 years agoMerge #11785
bors[bot] [Mon, 21 Mar 2022 23:33:58 +0000 (23:33 +0000)]
Merge #11785

11785: fix: Fix tuple- and record struct completions not working with existing braces r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix tuple- and record struct completions not working with existing braces
Lukas Wirth [Mon, 21 Mar 2022 20:45:29 +0000 (21:45 +0100)]
fix: Fix tuple- and record struct completions not working with existing braces

2 years agoMerge #11782
bors[bot] [Mon, 21 Mar 2022 18:42:24 +0000 (18:42 +0000)]
Merge #11782

11782: fix: Fix flyimport showing functions in pattern position r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix flyimport showing functions in pattern position
Lukas Wirth [Mon, 21 Mar 2022 18:41:39 +0000 (19:41 +0100)]
fix: Fix flyimport showing functions in pattern position

2 years agoClean up commented-out lines
Florian Diebold [Mon, 21 Mar 2022 18:16:58 +0000 (19:16 +0100)]
Clean up commented-out lines

2 years agoFix unreachable_pub
Florian Diebold [Mon, 21 Mar 2022 17:54:20 +0000 (18:54 +0100)]
Fix unreachable_pub

2 years agoFix expect
Florian Diebold [Mon, 21 Mar 2022 16:00:03 +0000 (17:00 +0100)]
Fix expect

2 years agoAdd a FIXME
Florian Diebold [Mon, 21 Mar 2022 15:49:01 +0000 (16:49 +0100)]
Add a FIXME

2 years agoImplement type checking for legacy_const_generics
Florian Diebold [Mon, 21 Mar 2022 15:43:19 +0000 (16:43 +0100)]
Implement type checking for legacy_const_generics

2 years agoCleanups
Florian Diebold [Sun, 20 Mar 2022 23:08:12 +0000 (00:08 +0100)]
Cleanups

2 years agoRemove old diagnostics
Florian Diebold [Sun, 20 Mar 2022 23:05:52 +0000 (00:05 +0100)]
Remove old diagnostics

2 years agoAdd 'remove this semicolon'
Florian Diebold [Sun, 20 Mar 2022 23:04:15 +0000 (00:04 +0100)]
Add 'remove this semicolon'

2 years agoAdd "add missing Ok/Some" fix
Florian Diebold [Sun, 20 Mar 2022 18:20:16 +0000 (19:20 +0100)]
Add "add missing Ok/Some" fix

2 years agoAdd new type-mismatch diagnostic
Florian Diebold [Sun, 20 Mar 2022 15:26:48 +0000 (16:26 +0100)]
Add new type-mismatch diagnostic

2 years agoExpose coercion logic in hir API
Florian Diebold [Sun, 20 Mar 2022 15:19:02 +0000 (16:19 +0100)]
Expose coercion logic in hir API

2 years agoExtract coercion logic to InferenceTable
Florian Diebold [Sun, 20 Mar 2022 12:42:47 +0000 (13:42 +0100)]
Extract coercion logic to InferenceTable

To make it accessible without an InferenceContext.

2 years agoMerge #11776
bors[bot] [Mon, 21 Mar 2022 09:04:40 +0000 (09:04 +0000)]
Merge #11776

11776: Replace write! with direct `Formatter` calls r=Veykril a=lnicola

The final executable is somehow larger (36 239 296 vs 36 238 336 bytes), but this saves us a bit of `text` and `data`:

```
   text    data     bss     dec     hex filename
23719199 1126625    4377 24850201 17b2f19 rust-analyzer-baseline
23716027 1126377    4377 24846781 17b21bd rust-analyzer-pr
```

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoReplace write! with direct calls
Laurențiu Nicola [Mon, 21 Mar 2022 08:43:36 +0000 (10:43 +0200)]
Replace write! with direct calls

2 years agoMerge #11690
bors[bot] [Sun, 20 Mar 2022 21:15:49 +0000 (21:15 +0000)]
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>
2 years agorefactor: Do more work in inline_type_alias closure
Steven Joruk [Sun, 20 Mar 2022 20:53:03 +0000 (20:53 +0000)]
refactor: Do more work in inline_type_alias closure

2 years agoMerge #11775
bors[bot] [Sun, 20 Mar 2022 18:31:27 +0000 (18:31 +0000)]
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>
2 years agointernal: Treat {global_}asm macros as unsafe
Lukas Wirth [Sun, 20 Mar 2022 18:27:46 +0000 (19:27 +0100)]
internal: Treat {global_}asm macros as unsafe

2 years agoMerge #11774
bors[bot] [Sun, 20 Mar 2022 18:15:29 +0000 (18:15 +0000)]
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>
2 years agoSimplify
Lukas Wirth [Sun, 20 Mar 2022 18:13:50 +0000 (19:13 +0100)]
Simplify

2 years agofeat: Tag macro calls as unsafe if they expand to unsafe expressions
Lukas Wirth [Sun, 20 Mar 2022 18:07:44 +0000 (19:07 +0100)]
feat: Tag macro calls as unsafe if they expand to unsafe expressions

2 years agoMerge #11771
bors[bot] [Sun, 20 Mar 2022 13:47:16 +0000 (13:47 +0000)]
Merge #11771

11771: feat: Visualize compiler inserted reborrows via inlay hints r=Veykril a=Veykril

Disabled by default.

![image](https://user-images.githubusercontent.com/3757771/159165178-baaf968a-4381-468e-933f-5326ca1b203d.png)

Closes https://github.com/rust-analyzer/rust-analyzer/issues/11275

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate inlay hint feature docs
Lukas Wirth [Sun, 20 Mar 2022 13:41:27 +0000 (14:41 +0100)]
Update inlay hint feature docs

2 years agofeat: Visualize compiler inserted reborrows via inlay hints
Lukas Wirth [Sun, 20 Mar 2022 13:38:16 +0000 (14:38 +0100)]
feat: Visualize compiler inserted reborrows via inlay hints

2 years agoMerge #11765
bors[bot] [Sat, 19 Mar 2022 19:26:34 +0000 (19:26 +0000)]
Merge #11765

11765: fix: Fix closure hints using macro ranges r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix closure hints using macro ranges
Lukas Wirth [Sat, 19 Mar 2022 19:24:09 +0000 (20:24 +0100)]
fix: Fix closure hints using macro ranges

2 years agoMerge #11755
bors[bot] [Sat, 19 Mar 2022 19:15:06 +0000 (19:15 +0000)]
Merge #11755

11755: feat: Implement lifetime elision hints r=Veykril a=Veykril

With names on:
![Code_erl26zKvuf](https://user-images.githubusercontent.com/3757771/159134856-e2c75d2d-f17c-45c7-9a78-3da5ee8b1acd.png)
With names off:
![Code_MRP1Pbfe9d](https://user-images.githubusercontent.com/3757771/159134857-30fac3a1-825e-4f49-ba9b-9fa0bb215694.png)

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoChange skip trivial behaviour
Lukas Wirth [Sat, 19 Mar 2022 19:12:14 +0000 (20:12 +0100)]
Change skip trivial behaviour

2 years agoAdd option to skip trivial cases
Lukas Wirth [Sat, 19 Mar 2022 18:01:19 +0000 (19:01 +0100)]
Add option to skip trivial cases

2 years agoUse numbers for lifetimes by default, add setting to prefer using parameter names
Lukas Wirth [Sat, 19 Mar 2022 17:11:56 +0000 (18:11 +0100)]
Use numbers for lifetimes by default, add setting to prefer using parameter names

2 years agoMerge #11761
bors[bot] [Fri, 18 Mar 2022 19:30:52 +0000 (19:30 +0000)]
Merge #11761

11761: internal: Rename call info to "signature help" r=jonas-schievink a=jonas-schievink

It is no longer limited to just calls

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoRename call info to "signature help"
Jonas Schievink [Fri, 18 Mar 2022 19:19:35 +0000 (20:19 +0100)]
Rename call info to "signature help"

It is no longer limited to just calls

2 years agoMerge #11760
bors[bot] [Fri, 18 Mar 2022 19:01:25 +0000 (19:01 +0000)]
Merge #11760

11760: feat: Provide signature help when editing generic args r=jonas-schievink a=jonas-schievink

![screenshot-2022-03-18-19:48:14](https://user-images.githubusercontent.com/1786438/159067106-3917a355-ca77-4d23-ad56-945dcc945425.png)

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoProvide signature help when editing generic args
Jonas Schievink [Fri, 18 Mar 2022 18:56:34 +0000 (19:56 +0100)]
Provide signature help when editing generic args

2 years agoFix test fixtures
Lukas Wirth [Fri, 18 Mar 2022 17:57:11 +0000 (18:57 +0100)]
Fix test fixtures

2 years agoGive the lifetimes better names
Lukas Wirth [Fri, 18 Mar 2022 17:55:03 +0000 (18:55 +0100)]
Give the lifetimes better names

2 years agofeat: Implement lifetime elision hints
Lukas Wirth [Fri, 18 Mar 2022 17:11:16 +0000 (18:11 +0100)]
feat: Implement lifetime elision hints

2 years agoMerge #11752
bors[bot] [Fri, 18 Mar 2022 16:38:32 +0000 (16:38 +0000)]
Merge #11752

11752: internal: Allow explicitly specifying end of fixture annotation r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Allow explicitly specifying end of fixture annotation
Lukas Wirth [Fri, 18 Mar 2022 14:30:58 +0000 (15:30 +0100)]
internal: Allow explicitly specifying end of fixture annotation

2 years agoMerge #11753
bors[bot] [Fri, 18 Mar 2022 14:37:59 +0000 (14:37 +0000)]
Merge #11753

11753: feat: Complete assoc const patterns on builtin types r=jonas-schievink a=jonas-schievink

followup to https://github.com/rust-analyzer/rust-analyzer/pull/11713

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoComplete assoc const patterns on builtin types
Jonas Schievink [Fri, 18 Mar 2022 14:34:31 +0000 (15:34 +0100)]
Complete assoc const patterns on builtin types

2 years agoMerge #11713
bors[bot] [Fri, 18 Mar 2022 13:54:09 +0000 (13:54 +0000)]
Merge #11713

11713: Complete associated consts in patterns  r=jonas-schievink a=hi-rustin

Try close https://github.com/rust-analyzer/rust-analyzer/issues/11555

Co-authored-by: hi-rustin <rustin.liu@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoUpdate crates/ide_completion/src/tests/pattern.rs
Jonas Schievink [Fri, 18 Mar 2022 13:53:44 +0000 (14:53 +0100)]
Update crates/ide_completion/src/tests/pattern.rs

2 years agoMerge #11750
bors[bot] [Fri, 18 Mar 2022 11:13:37 +0000 (11:13 +0000)]
Merge #11750

11750: fix: Fix runnables trying to add doc tests in the crate root from #[macro_export] macros r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11746
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix runnables trying to add doc tests in the crate root from #[macro_export...
Lukas Wirth [Fri, 18 Mar 2022 10:55:53 +0000 (11:55 +0100)]
fix: Fix runnables trying to add doc tests in the crate root from #[macro_export] macros

2 years agoMerge #11747
bors[bot] [Fri, 18 Mar 2022 07:19:42 +0000 (07:19 +0000)]
Merge #11747

11747: minor: Remove Update GitHub API token command r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoRemove Update GitHub API token command
Laurențiu Nicola [Fri, 18 Mar 2022 07:19:02 +0000 (09:19 +0200)]
Remove Update GitHub API token command

2 years agoMerge #11744
bors[bot] [Thu, 17 Mar 2022 17:25:07 +0000 (17:25 +0000)]
Merge #11744

11744: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump deps
Laurențiu Nicola [Thu, 17 Mar 2022 17:10:45 +0000 (19:10 +0200)]
Bump deps

2 years agoMerge #11743
bors[bot] [Thu, 17 Mar 2022 16:28:21 +0000 (16:28 +0000)]
Merge #11743

11743: fix: Properly unify receivers during method resolution r=flodiebold a=flodiebold

This fixes our type inference problems with `DynMap`; the problem there were the projection types in
```rust
impl<P: Policy> KeyMap<Key<P::K, P::V, P>>
```
which messed up the naive type equality check we did. It also actually simplifies the logic though, IMO. I also added a fix for associated const resolution that I noticed (visibility not being taken into account).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoMove fallback_bound_vars to the only place it's used now
Florian Diebold [Thu, 17 Mar 2022 16:08:43 +0000 (17:08 +0100)]
Move fallback_bound_vars to the only place it's used now

2 years agoFixes for consts
Florian Diebold [Thu, 17 Mar 2022 16:02:58 +0000 (17:02 +0100)]
Fixes for consts

2 years agoSnapshot obligations
Florian Diebold [Thu, 17 Mar 2022 13:29:39 +0000 (14:29 +0100)]
Snapshot obligations

2 years agoProperly try unifying the receivers during method resolution
Florian Diebold [Thu, 17 Mar 2022 11:39:42 +0000 (12:39 +0100)]
Properly try unifying the receivers during method resolution

Instead of hackily checking if they're equal.

2 years agoFix typo
hi-rustin [Thu, 17 Mar 2022 14:59:47 +0000 (22:59 +0800)]
Fix typo

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoAdd test for DynMap type inference
Florian Diebold [Sun, 13 Mar 2022 15:25:03 +0000 (16:25 +0100)]
Add test for DynMap type inference

2 years agoMatch the enum and union
hi-rustin [Thu, 17 Mar 2022 13:18:52 +0000 (21:18 +0800)]
Match the enum and union

Signed-off-by: hi-rustin <rustin.liu@gmail.com>