]>
git.lizzy.rs Git - rust.git/log
ice1000 [Tue, 3 Dec 2019 16:07:56 +0000 (11:07 -0500)]
Replace `ra_hir_expand::either` with crate
bors[bot] [Tue, 3 Dec 2019 14:02:23 +0000 (14:02 +0000)]
Merge #2468
2468: Fix #2467 r=flodiebold a=flodiebold
The stand-alone `unify` requires that the type doesn't contain any type
variables. So we can't share the code here for now (without more refactoring)...
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Tue, 3 Dec 2019 13:59:29 +0000 (14:59 +0100)]
Fix #2467
The stand-alone `unify` requires that the type doesn't contain any type
variables. So we can't share the code here for now (without more refactoring)...
bors[bot] [Tue, 3 Dec 2019 13:43:05 +0000 (13:43 +0000)]
Merge #2465
2465: Extract built-in trait implementations to separate module r=matklad a=flodiebold
This untangles the builtin logic from the Chalk translation.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
bors[bot] [Tue, 3 Dec 2019 12:58:44 +0000 (12:58 +0000)]
Merge #2463
2463: More correct method resolution r=flodiebold a=flodiebold
This should fix the order in which candidates for method resolution are considered, i.e. `(&Foo).clone()` should now be of type `Foo` instead of `&Foo`. It also checks for inherent candidates that the self type unifies properly with the self type in the impl (i.e. `impl Foo<u32>` methods will only be considered for `Foo<u32>`).
To be able to get the correct receiver type to check in the method resolution, I needed the unification logic, so I extracted it to the `unify.rs` module.
Should fix #2435.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Tue, 3 Dec 2019 12:58:02 +0000 (13:58 +0100)]
Make unify pub(crate)
Florian Diebold [Tue, 3 Dec 2019 11:16:39 +0000 (12:16 +0100)]
Extract built-in trait implementations to separate module
This untangles the builtin logic from the Chalk translation.
Florian Diebold [Mon, 2 Dec 2019 18:27:31 +0000 (19:27 +0100)]
Add tests for checking the impl self type
Florian Diebold [Mon, 2 Dec 2019 17:12:49 +0000 (18:12 +0100)]
Refactor a bit
Florian Diebold [Sun, 1 Dec 2019 21:14:28 +0000 (22:14 +0100)]
Check receiver type properly
Florian Diebold [Sun, 1 Dec 2019 19:30:28 +0000 (20:30 +0100)]
Extract unification code to unify module
Florian Diebold [Sat, 2 Nov 2019 14:18:26 +0000 (15:18 +0100)]
Change order of calls to get method candidate order correct
bors[bot] [Mon, 2 Dec 2019 15:52:11 +0000 (15:52 +0000)]
Merge #2018
2018: assists: add assist for custom implementation for derived trait r=matklad a=paulolieuthier
Please, tell me if something could be more idiomatic or efficient.
Fixes #1256.
Co-authored-by: Paulo Lieuthier <paulolieuthier@gmail.com>
bors[bot] [Mon, 2 Dec 2019 14:19:12 +0000 (14:19 +0000)]
Merge #2462
2462: Switch back to npm install r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 2 Dec 2019 14:17:55 +0000 (15:17 +0100)]
Switch back to npm install
Locks like it honors package.lock nowdays
bors[bot] [Mon, 2 Dec 2019 12:42:33 +0000 (12:42 +0000)]
Merge #2457
2457: Clarify installation instructions r=matklad a=fintelia
In particular it is necessary to clone the repository before running the other commands. I also removed the `cargo install` side note because it didn't actually work (running the command just produces an error that --package isn't a recognized flag) and added a tldr code block with the list of commands to run.
Co-authored-by: Jonathan Behrens <fintelia@gmail.com>
bors[bot] [Sun, 1 Dec 2019 20:02:01 +0000 (20:02 +0000)]
Merge #2461
2461: anyhow, libc, syn, cargo_metadata r=kjeremy a=kjeremy
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Jeremy Kolb [Sun, 1 Dec 2019 20:00:34 +0000 (15:00 -0500)]
Just update some things
Jonathan Behrens [Sun, 1 Dec 2019 18:29:01 +0000 (13:29 -0500)]
Add back corrected `cargo install` command
bors[bot] [Sun, 1 Dec 2019 11:13:25 +0000 (11:13 +0000)]
Merge #2455
2455: Add BuiltinShadowMode r=flodiebold a=edwin0cheng
This PR try to fix #1905 by introduce an `BuiltinShadowMode` in name resolving functions.
cc @flodiebold
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Sun, 1 Dec 2019 04:17:52 +0000 (12:17 +0800)]
Remove some empty lines
Edwin Cheng [Sun, 1 Dec 2019 04:14:35 +0000 (12:14 +0800)]
Use index instead of peekable
Edwin Cheng [Sun, 1 Dec 2019 04:14:12 +0000 (12:14 +0800)]
Fix comment
Jonathan Behrens [Sun, 1 Dec 2019 02:20:54 +0000 (21:20 -0500)]
Clarify installation instructions
In particular it is necessary to clone the repository before running the other commands. I also removed the `cargo install` side note because it didn't actually work (running the command just produces an error that --package isn't a recognized flag) and added a tldr code block with the list of commands to run.
bors[bot] [Sat, 30 Nov 2019 19:19:28 +0000 (19:19 +0000)]
Merge #2451
2451: Use env_logger instead of flexi_logger r=matklad a=AlexanderEkdahl
This fixes https://github.com/rust-analyzer/rust-analyzer/issues/2335
- By default only `error` will be printed. From what I can tell this matches the current behaviour. Configured through `RUST_LOG`.
- I looked through the optional dependencies for `env_logger`and I have only enabled `human_time`. Without this feature no timestamp will be shown for log messages.
- `RA_LOG_DIR` feature is removed
This PR adds 2 new dependencies(`env_logger` and `human_time`) and removes 6 dependencies.
Co-authored-by: Alexander Ekdahl <alexander@ekdahl.io>
Edwin Cheng [Sat, 30 Nov 2019 15:29:21 +0000 (23:29 +0800)]
Add BuiltinShadowMode
bors[bot] [Sat, 30 Nov 2019 14:23:18 +0000 (14:23 +0000)]
Merge #2453
2453: Handle various cycles r=matklad a=flodiebold
- handle `impl Trait<Self> for SomeType`, which is allowed. This necessitated splitting the `impl_ty` query, but I think the result actually makes a lot of code nicer. This should fix #2446.
- add recovery for `impl Trait for SomeType<Self>`
- add recovery for `type Type = Foo<Type>`
- add recovery for cycles in generic param env
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Sat, 30 Nov 2019 11:48:51 +0000 (12:48 +0100)]
Add cycle recovery for type aliases
Florian Diebold [Sat, 30 Nov 2019 11:39:21 +0000 (12:39 +0100)]
Add cycle recovery for generic predicates
Florian Diebold [Sat, 30 Nov 2019 11:35:37 +0000 (12:35 +0100)]
Handle cycles in impl types better
- impl Trait<Self> for S is allowed
- impl Trait for S<Self> is an invalid cycle, but we can add cycle recovery for
it in Salsa now
bors[bot] [Sat, 30 Nov 2019 10:43:35 +0000 (10:43 +0000)]
Merge #2449
2449: Only allow renames to valid identifiers r=matklad a=detrumi
Implements #2121
Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
Alexander Ekdahl [Sat, 30 Nov 2019 00:40:59 +0000 (19:40 -0500)]
Remove log dependency from ra_cli
Alexander Ekdahl [Sat, 30 Nov 2019 00:36:48 +0000 (19:36 -0500)]
Update README
Alexander Ekdahl [Sat, 30 Nov 2019 00:35:03 +0000 (19:35 -0500)]
Remove flexi_logger from ra_lsp_server
Alexander Ekdahl [Sat, 30 Nov 2019 00:20:48 +0000 (19:20 -0500)]
Use env_logger in ra_cli
bors[bot] [Fri, 29 Nov 2019 19:34:02 +0000 (19:34 +0000)]
Merge #2445
2445: Infer range types r=flodiebold a=oxalica
Co-authored-by: oxalica <oxalicc@pm.me>
Wilco Kusee [Fri, 29 Nov 2019 15:06:20 +0000 (16:06 +0100)]
Push identifier check to rename function
Wilco Kusee [Fri, 29 Nov 2019 15:03:39 +0000 (16:03 +0100)]
Test rename for various identifiers
Wilco Kusee [Fri, 29 Nov 2019 14:52:12 +0000 (15:52 +0100)]
Move identifier check to analysis
Wilco Kusee [Fri, 29 Nov 2019 14:27:22 +0000 (15:27 +0100)]
Also allow renaming to underscore
Wilco Kusee [Fri, 29 Nov 2019 14:14:42 +0000 (15:14 +0100)]
Only allow renames to valid identifiers
oxalica [Fri, 29 Nov 2019 06:49:12 +0000 (14:49 +0800)]
Reduce variants of Expr
Paulo Lieuthier [Sat, 19 Oct 2019 11:19:06 +0000 (08:19 -0300)]
docs: describe new feature 'add custom impl for derived trait'
Paulo Lieuthier [Tue, 15 Oct 2019 18:29:20 +0000 (15:29 -0300)]
assists: add assist for custom implementation for derived trait
oxalica [Thu, 28 Nov 2019 19:10:16 +0000 (03:10 +0800)]
Infer range types
bors[bot] [Thu, 28 Nov 2019 16:05:46 +0000 (16:05 +0000)]
Merge #2442
2442: Move source-related traits to a separate module r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 28 Nov 2019 15:05:28 +0000 (18:05 +0300)]
Move source-related traits to a separate module
bors[bot] [Thu, 28 Nov 2019 13:04:52 +0000 (13:04 +0000)]
Merge #2441
2441: Use InFile for AstId r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 28 Nov 2019 13:00:03 +0000 (16:00 +0300)]
Use InFile for AstId
bors[bot] [Thu, 28 Nov 2019 10:02:46 +0000 (10:02 +0000)]
Merge #2440
2440: Rename Source -> InFile r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 28 Nov 2019 09:50:26 +0000 (12:50 +0300)]
Rename Source -> InFile
bors[bot] [Thu, 28 Nov 2019 08:46:36 +0000 (08:46 +0000)]
Merge #2438
2438: Derive Hash for tt::TokenTree r=matklad a=edwin0cheng
Preparation for intern `TokenTree` to salsa database
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Thu, 28 Nov 2019 05:41:58 +0000 (13:41 +0800)]
Derive Hash for TokenTrees
bors[bot] [Wed, 27 Nov 2019 23:06:40 +0000 (23:06 +0000)]
Merge #2437
2437: Update mio and anyhow r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Wed, 27 Nov 2019 23:05:49 +0000 (18:05 -0500)]
Update mio and anyhow
bors[bot] [Wed, 27 Nov 2019 20:27:01 +0000 (20:27 +0000)]
Merge #2433
2433: Use Name::missing consistently r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 20:22:20 +0000 (23:22 +0300)]
Use Name::missing consistently
bors[bot] [Wed, 27 Nov 2019 19:30:38 +0000 (19:30 +0000)]
Merge #2432
2432: Minimize API r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 19:21:01 +0000 (22:21 +0300)]
Minimize API
bors[bot] [Wed, 27 Nov 2019 19:13:34 +0000 (19:13 +0000)]
Merge #2431
2431: Memoize impl resolutions r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 19:12:09 +0000 (22:12 +0300)]
Memoize impl resolutions
bors[bot] [Wed, 27 Nov 2019 18:45:05 +0000 (18:45 +0000)]
Merge #2430
2430: rename ra_ide_api -> ra_ide r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 18:44:38 +0000 (21:44 +0300)]
Reformat
Aleksey Kladov [Wed, 27 Nov 2019 18:32:33 +0000 (21:32 +0300)]
rename ra_ide_api -> ra_ide
Aleksey Kladov [Wed, 27 Nov 2019 18:31:51 +0000 (21:31 +0300)]
Rename module_id -> local_id
bors[bot] [Wed, 27 Nov 2019 18:27:45 +0000 (18:27 +0000)]
Merge #2429
2429: Move type inference to a separate crate r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 18:23:31 +0000 (21:23 +0300)]
prune deps
Aleksey Kladov [Wed, 27 Nov 2019 14:46:02 +0000 (17:46 +0300)]
Move Ty
Aleksey Kladov [Wed, 27 Nov 2019 13:48:48 +0000 (16:48 +0300)]
Decouple
bors[bot] [Wed, 27 Nov 2019 13:41:55 +0000 (13:41 +0000)]
Merge #2428
2428: Remove TypableDef r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 13:39:58 +0000 (16:39 +0300)]
Remove TypableDef
Aleksey Kladov [Wed, 27 Nov 2019 13:29:11 +0000 (16:29 +0300)]
Cleanup imports
Aleksey Kladov [Wed, 27 Nov 2019 13:25:01 +0000 (16:25 +0300)]
Use Id for variats
Aleksey Kladov [Wed, 27 Nov 2019 13:02:33 +0000 (16:02 +0300)]
More decoupling
Aleksey Kladov [Wed, 27 Nov 2019 12:56:20 +0000 (15:56 +0300)]
Decouple more
bors[bot] [Wed, 27 Nov 2019 09:51:02 +0000 (09:51 +0000)]
Merge #2427
2427: Decouple r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 09:47:18 +0000 (12:47 +0300)]
Decouple
bors[bot] [Wed, 27 Nov 2019 09:34:54 +0000 (09:34 +0000)]
Merge #2426
2426: Decouple r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 09:31:40 +0000 (12:31 +0300)]
Decouple
Aleksey Kladov [Wed, 27 Nov 2019 09:13:07 +0000 (12:13 +0300)]
Cleanup imports
bors[bot] [Wed, 27 Nov 2019 09:05:39 +0000 (09:05 +0000)]
Merge #2425
2425: Decouple r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 09:02:54 +0000 (12:02 +0300)]
Decouple
Aleksey Kladov [Wed, 27 Nov 2019 08:40:10 +0000 (11:40 +0300)]
Decouple
bors[bot] [Wed, 27 Nov 2019 06:51:37 +0000 (06:51 +0000)]
Merge #2424
2424: Crate -> CrateId r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 06:42:55 +0000 (09:42 +0300)]
Crate -> CrateId
bors[bot] [Tue, 26 Nov 2019 21:02:32 +0000 (21:02 +0000)]
Merge #2422
2422: Use a simple progress bar instead of indicatif r=maklad a=edwin0cheng
![pb](https://user-images.githubusercontent.com/
11014119 /
69669230 -
6a3d5a80 -10cc-11ea-8ad7-
4dccb10349c9 .gif)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Tue, 26 Nov 2019 21:01:13 +0000 (05:01 +0800)]
Fill all last text to space and return the cursor
Edwin Cheng [Tue, 26 Nov 2019 20:33:40 +0000 (04:33 +0800)]
Remove progress bar and add a true counter
Edwin Cheng [Tue, 26 Nov 2019 20:16:03 +0000 (04:16 +0800)]
Remove commented code
Edwin Cheng [Tue, 26 Nov 2019 20:09:30 +0000 (04:09 +0800)]
Use a simple progress bar instead of indicatif
bors[bot] [Tue, 26 Nov 2019 19:56:35 +0000 (19:56 +0000)]
Merge #2421
2421: Cleanup r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 19:56:07 +0000 (22:56 +0300)]
Cleanup
Aleksey Kladov [Tue, 26 Nov 2019 19:26:47 +0000 (22:26 +0300)]
Decouple
bors[bot] [Tue, 26 Nov 2019 18:42:52 +0000 (18:42 +0000)]
Merge #2420
2420: Remove last traces of adt from Ty r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
bors[bot] [Tue, 26 Nov 2019 18:34:15 +0000 (18:34 +0000)]
Merge #2418
2418: Hide MacroCallLoc outside hir_expand r=matklad a=edwin0cheng
This PR refactor `MacroCallLoc` such that it be hided to become implementation details of hir_expand.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 18:25:17 +0000 (21:25 +0300)]
Remove last traces of adt from Ty
Aleksey Kladov [Tue, 26 Nov 2019 18:18:26 +0000 (21:18 +0300)]
More precise NameKind::Self
bors[bot] [Tue, 26 Nov 2019 18:07:21 +0000 (18:07 +0000)]
Merge #2419
2419: Remove ns-polymorphic type_for_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 18:04:24 +0000 (21:04 +0300)]
Remove ns-polymorphic type_for_def
Edwin Cheng [Tue, 26 Nov 2019 17:33:08 +0000 (01:33 +0800)]
Hide MacroCallLoc