]>
git.lizzy.rs Git - rust.git/log
bors[bot] [Sun, 17 Mar 2019 21:41:37 +0000 (21:41 +0000)]
Merge #982
982: Implement BindingMode for pattern matching. r=flodiebold a=mjkillough
Implement `BindingMode` for pattern matching, so that types can be
correctly inferred using match ergonomics. The binding mode defaults to
`Move` (referred to as 'BindingMode::BindByValue` in rustc), and is
updated by automatic dereferencing of the value being matched.
Fixes #888.
- [Binding modes in The Reference](https://doc.rust-lang.org/reference/patterns.html#binding-modes)
- [`rustc` implementation](https://github.com/rust-lang/rust/blob/
e17c48e2f21eefd59748e364234efc7037a3ec96 /src/librustc_typeck/check/_match.rs#L77) (and [definition of `BindingMode`](https://github.com/rust-lang/rust/blob/
e957ed9d10ec589bdd523b88b4b44c41b1ecf763 /src/librustc/ty/binding.rs))
- [Match Ergonomics RFC](https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#binding-mode-rules)
Co-authored-by: Michael Killough <michaeljkillough@gmail.com>
Michael Killough [Sun, 17 Mar 2019 19:05:10 +0000 (19:05 +0000)]
Split test case and use tested_by!.
Michael Killough [Sun, 17 Mar 2019 18:50:22 +0000 (18:50 +0000)]
Simplify match statement.
Michael Killough [Sun, 17 Mar 2019 18:46:01 +0000 (18:46 +0000)]
impl Default for BindingMode.
This decouples callers from knowing what the default binding mode of
pattern matching is.
bors[bot] [Sun, 17 Mar 2019 14:34:14 +0000 (14:34 +0000)]
Merge #983
983: support remainder assignment operator r=matklad a=JeanMertz
`%=` was returning errors for me, turns out it wasn't added as a valid assignment operation.
I'm not sure what the best location would be to add a test for this. Please let me know and I'll add one.
Co-authored-by: Jean Mertz <jean@mertz.fm>
Jean Mertz [Sat, 16 Mar 2019 21:08:50 +0000 (22:08 +0100)]
support remainder assignment operator
bors[bot] [Sun, 17 Mar 2019 12:14:36 +0000 (12:14 +0000)]
Merge #986
986: Fix parse tree of attribute on match arm r=matklad a=pcpthm
```rust
match () {
#[attr]
() => (),
}
```
Incorrect parse tree: `MatchArmList(Attr(..), MatchArm(..))`.
Fixed: `MatchArmList(MatchArm(Attr(..), ...))`.
Co-authored-by: pcpthm <pcpthm@gmail.com>
pcpthm [Sun, 17 Mar 2019 11:57:27 +0000 (20:57 +0900)]
Fix parse tree of attribute on match arm
bors[bot] [Sun, 17 Mar 2019 10:26:45 +0000 (10:26 +0000)]
Merge #985
985: simplify parsing blocks a bit r=pcpthm a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
bors[bot] [Sun, 17 Mar 2019 10:16:34 +0000 (10:16 +0000)]
Merge #984
984: Allow attribute on struct literal field r=matklad a=pcpthm
Cherrypicked from #980
Co-authored-by: pcpthm <pcpthm@gmail.com>
Aleksey Kladov [Sun, 17 Mar 2019 10:14:17 +0000 (13:14 +0300)]
simplify parsing blocks a bit
pcpthm [Sat, 16 Mar 2019 15:27:07 +0000 (00:27 +0900)]
Allow attribute on struct literal field
bors[bot] [Sun, 17 Mar 2019 09:59:04 +0000 (09:59 +0000)]
Merge #968
968: Macro aware name resoltion r=matklad a=matklad
The first commit lays the ground work for new name resolution, including
* extracting position-indendent items from parse trees
* walking the tree of modules
* old-style macro_rules resolve
cc @pnkfelix: this looks like an API name resolution should interact with.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 17 Mar 2019 09:43:25 +0000 (12:43 +0300)]
docs
Aleksey Kladov [Sun, 17 Mar 2019 09:06:30 +0000 (12:06 +0300)]
remove fixme
Aleksey Kladov [Sat, 16 Mar 2019 16:40:41 +0000 (19:40 +0300)]
remove old macro support
Aleksey Kladov [Sat, 16 Mar 2019 15:57:53 +0000 (18:57 +0300)]
rename ModuleId -> CrateModuleId
Aleksey Kladov [Sat, 16 Mar 2019 15:06:45 +0000 (18:06 +0300)]
fix error on wrong path
Aleksey Kladov [Sat, 16 Mar 2019 14:52:26 +0000 (17:52 +0300)]
log time
Aleksey Kladov [Sat, 16 Mar 2019 14:17:50 +0000 (17:17 +0300)]
Reorganize name resolution
Aleksey Kladov [Sat, 16 Mar 2019 12:45:21 +0000 (15:45 +0300)]
hack around non-terminating macro expansion
Aleksey Kladov [Thu, 14 Mar 2019 10:14:54 +0000 (13:14 +0300)]
remove lower module
Aleksey Kladov [Thu, 14 Mar 2019 09:54:03 +0000 (12:54 +0300)]
remove ItemMap
Aleksey Kladov [Thu, 14 Mar 2019 08:53:40 +0000 (11:53 +0300)]
move tests over to crate-def-map
Aleksey Kladov [Wed, 13 Mar 2019 13:38:02 +0000 (16:38 +0300)]
Replace module_tree with CrateDefMap
Aleksey Kladov [Wed, 13 Mar 2019 13:04:28 +0000 (16:04 +0300)]
add name resolution from the old impl
unlike the old impl, this also handles macro imports across crates
Aleksey Kladov [Sat, 2 Mar 2019 20:59:04 +0000 (23:59 +0300)]
add skeleton for macro-aware name resolutions
bors[bot] [Sun, 17 Mar 2019 08:51:06 +0000 (08:51 +0000)]
Merge #947
947: Add missing impl members r=matklad a=Xanewok
Closes #878.
This took longer than expected as I wrapped my head around the API and the project - hopefully I didn't miss any edge case here.
r? @matklad
Co-authored-by: Igor Matuszewski <xanewok@gmail.com>
Igor Matuszewski [Sat, 16 Mar 2019 22:24:17 +0000 (23:24 +0100)]
Move the primary assist fn to the top of the file
Igor Matuszewski [Sat, 16 Mar 2019 22:19:14 +0000 (23:19 +0100)]
Provide assist when cursor is immediately outside impl item block
Igor Matuszewski [Thu, 7 Mar 2019 15:20:37 +0000 (16:20 +0100)]
Do a cleanup/legibility pass
Igor Matuszewski [Thu, 7 Mar 2019 15:10:21 +0000 (16:10 +0100)]
Take into account parent indent when filling trait members
Igor Matuszewski [Thu, 7 Mar 2019 15:10:03 +0000 (16:10 +0100)]
Simplify trait resolution fragment
Igor Matuszewski [Thu, 7 Mar 2019 12:44:01 +0000 (13:44 +0100)]
Ignore unnamed trait fns and add more tests
Igor Matuszewski [Thu, 7 Mar 2019 12:36:35 +0000 (13:36 +0100)]
Simplify calculation of missing functions
Asymptotically computing a set difference is faster but in the average
case we won't have more than ~10 functions. Also prefer not using hash
sets as these may yield nondeterministic results.
Igor Matuszewski [Thu, 7 Mar 2019 12:21:56 +0000 (13:21 +0100)]
Properly support the case when the cursor is inside an empty block or outside
Igor Matuszewski [Thu, 7 Mar 2019 11:02:53 +0000 (12:02 +0100)]
Redo indent calculation when adding missing impl members
Igor Matuszewski [Thu, 7 Mar 2019 00:48:31 +0000 (01:48 +0100)]
Implement a simple working assist
Igor Matuszewski [Wed, 6 Mar 2019 22:45:11 +0000 (23:45 +0100)]
Calculate missing functions from impl body
Igor Matuszewski [Wed, 6 Mar 2019 13:41:22 +0000 (14:41 +0100)]
Add 'add_missing_impl_members' assist stub
Michael Killough [Sat, 16 Mar 2019 18:13:13 +0000 (18:13 +0000)]
Implement BindingMode for pattern matching.
Implement `BindingMode` for pattern matching, so that types can be
correctly inferred using match ergonomics. The binding mode defaults to
`Move` (referred to as 'BindingMode::BindByValue` in rustc), and is
updated by automatic dereferencing of the value being matched.
bors[bot] [Sat, 16 Mar 2019 17:24:55 +0000 (17:24 +0000)]
Merge #981
981: Remove FnSig from FnDef type r=matklad a=flodiebold
It doesn't need to be in there since it's just information from the def. Another
step towards aligning Ty with Chalk's representation.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Sat, 16 Mar 2019 16:29:55 +0000 (17:29 +0100)]
Remove FnSig from FnDef type
It doesn't need to be in there since it's just information from the def. Another
step towards aligning Ty with Chalk's representation.
Florian Diebold [Sat, 16 Mar 2019 16:21:32 +0000 (17:21 +0100)]
Refactor FnSig a bit
Florian Diebold [Sat, 16 Mar 2019 15:50:31 +0000 (16:50 +0100)]
Some more Ty displaying cleanup
bors[bot] [Sat, 16 Mar 2019 15:42:36 +0000 (15:42 +0000)]
Merge #976
976: Replace Display by a pretty printing trait for Ty r=matklad a=flodiebold
This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)
I may have gone a bit overboard with the definition of the PrettyPrint trait...
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Florian Diebold [Thu, 14 Mar 2019 21:03:39 +0000 (22:03 +0100)]
Replace Display by a pretty printing trait for Ty
This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)
bors[bot] [Fri, 15 Mar 2019 21:15:43 +0000 (21:15 +0000)]
Merge #978
978: Update some dependencies r=matklad a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Fri, 15 Mar 2019 15:36:25 +0000 (11:36 -0400)]
Update some dependencies
bors[bot] [Fri, 15 Mar 2019 05:03:50 +0000 (05:03 +0000)]
Merge #977
977: Fix ra-emacs-lsp for newest lsp-mode with native json support r=matklad a=flodiebold
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Florian Diebold [Thu, 14 Mar 2019 21:08:37 +0000 (22:08 +0100)]
Fix ra-emacs-lsp for newest lsp-mode with native json support
bors[bot] [Thu, 14 Mar 2019 10:29:29 +0000 (10:29 +0000)]
Merge #975
975: sort navigations to make tests stable r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 14 Mar 2019 10:27:21 +0000 (13:27 +0300)]
sort navigations to make tests stable
bors[bot] [Thu, 14 Mar 2019 09:17:21 +0000 (09:17 +0000)]
Merge #974
974: Add MINUS token the PATTERN_FIRST token set r=matklad a=mchesser
Fixes: #972
Co-authored-by: Michael Chesser <michaelchesser@outlook.com>
Michael Chesser [Thu, 14 Mar 2019 08:52:37 +0000 (19:22 +1030)]
Add test for minus in inner pattern
Michael Chesser [Wed, 13 Mar 2019 23:38:49 +0000 (10:08 +1030)]
Allow MINUS at the start of a pattern.
bors[bot] [Thu, 14 Mar 2019 08:32:13 +0000 (08:32 +0000)]
Merge #973
973: derive Hash for ra_hir::ModuleDef r=matklad a=pcpthm
I wanted to use `HashSet` but it seems like `Hash` derive is missing for no reason.
Co-authored-by: pcpthm <pcpthm@gmail.com>
pcpthm [Thu, 14 Mar 2019 08:25:51 +0000 (17:25 +0900)]
derive Hash for ra_hir::ModuleDef
bors[bot] [Thu, 14 Mar 2019 07:04:56 +0000 (07:04 +0000)]
Merge #971
971: Point to compiler-team repo in the readme r=matklad a=detrumi
The readme still links to the old repo, which redirects to the new one
Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
Wilco Kusee [Wed, 13 Mar 2019 18:36:26 +0000 (19:36 +0100)]
Point to the compiler-team repo directly
bors[bot] [Wed, 13 Mar 2019 14:50:38 +0000 (14:50 +0000)]
Merge #970
970: Fix typo r=matklad a=skade
Co-authored-by: Florian Gilcher <florian.gilcher@asquera.de>
Florian Gilcher [Wed, 13 Mar 2019 14:23:22 +0000 (15:23 +0100)]
Fix typo
bors[bot] [Wed, 13 Mar 2019 13:39:24 +0000 (13:39 +0000)]
Merge #969
969: activate extension if Cargo.toml is present r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 13 Mar 2019 13:14:30 +0000 (16:14 +0300)]
activate extension if Cargo.toml is present
bors[bot] [Tue, 12 Mar 2019 10:23:47 +0000 (10:23 +0000)]
Merge #959
959: Retrieve current working directory from workspace r=matklad a=LDSpits
This PR improves the way the language client retrieves the current working directory by using the VSCode workspace API to get the path to the currently open directory.
If we find more than one directory we show a warning that "multi root workspaces are not supported yet" and pick the root path.
Any feedback is appreciated 😄
fixes #945
Co-authored-by: Lucas Spits <spits.lucas@gmail.com>
bors[bot] [Tue, 12 Mar 2019 10:16:04 +0000 (10:16 +0000)]
Merge #958
958: LSP: Support EnumMember and Field r=matklad a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
bors[bot] [Tue, 12 Mar 2019 09:38:24 +0000 (09:38 +0000)]
Merge #962
962: remove Def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 12 Mar 2019 09:36:37 +0000 (12:36 +0300)]
remove Def
Lucas Spits [Mon, 11 Mar 2019 20:22:54 +0000 (21:22 +0100)]
Applied code style of ``npm run fix``
Lucas Spits [Mon, 11 Mar 2019 19:53:56 +0000 (20:53 +0100)]
Fix typescript linting errors
Lucas Spits [Mon, 11 Mar 2019 19:41:48 +0000 (20:41 +0100)]
Merge branch 'master' of https://github.com/LDSpits/rust-analyzer into feature/workspace-directory
Lucas Spits [Mon, 11 Mar 2019 19:38:46 +0000 (20:38 +0100)]
Retrieve current directory from workspaces
kjeremy [Mon, 11 Mar 2019 17:58:38 +0000 (13:58 -0400)]
LSP: Support EnumMember and Field
bors[bot] [Sun, 10 Mar 2019 17:37:41 +0000 (17:37 +0000)]
Merge #956
956: Add async keyword r=c410-f3r a=c410-f3r
Fixes #954.
Co-authored-by: Caio <c410.f3r@gmail.com>
Caio [Sun, 10 Mar 2019 17:35:25 +0000 (14:35 -0300)]
Add test for async block
bors[bot] [Sun, 10 Mar 2019 14:21:10 +0000 (14:21 +0000)]
Merge #957
957: Fix and simplify "rustc-watch" problem matcher r=vemoo a=vemoo
Cargo watch now always ends with "[Finished running ..." and includes some extra info. Make the pattern only match "[Finished running".
Also add "cargo watch" and "cargo watch tests" that use the "rustc-watch" problem matcher.
Change the "Build Lsp" to do "cargo check" because that's faster, and I think enought in this case, and make it use "rustc" problem matcher from the extension.
Co-authored-by: Bernardo <berublan@gmail.com>
Bernardo [Sun, 10 Mar 2019 14:20:27 +0000 (15:20 +0100)]
prettier format
Bernardo [Sun, 10 Mar 2019 13:57:30 +0000 (14:57 +0100)]
revert change to "check" since "build" is intentional
Bernardo [Sun, 10 Mar 2019 12:54:18 +0000 (13:54 +0100)]
add cargo watch tasks
use extension problemMatcher
Bernardo [Sun, 24 Feb 2019 12:41:19 +0000 (13:41 +0100)]
simplify watch patterns
Caio [Sat, 9 Mar 2019 23:40:22 +0000 (20:40 -0300)]
Add async keyword
bors[bot] [Sat, 9 Mar 2019 12:21:28 +0000 (12:21 +0000)]
Merge #953
953: Don't default publishDecorations and showWorkspaceLoaded to true on the server r=matklad a=flodiebold
If the client doesn't specify these explicitly, that very likely means it
doesn't know about them and so we shouldn't send them. In particular, the recent
change to this default caused decorations to be sent to emacs, resulting in a
lot of warning spam.
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Florian Diebold [Thu, 7 Mar 2019 20:06:25 +0000 (21:06 +0100)]
Don't default publishDecorations to true on the server
If the client doesn't specify this explicitly, that very likely means it doesn't
know about it and so we shouldn't send decorations. In particular, the recent
change to this default caused decorations to be sent to emacs, resulting in a
lot of warning spam.
bors[bot] [Fri, 8 Mar 2019 21:52:23 +0000 (21:52 +0000)]
Merge #955
955: Remove superfluous semicolons r=kjeremy a=kjeremy
Doesn't change the result of the test but it does prevent the
syntax tree from rendering.
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Fri, 8 Mar 2019 21:45:26 +0000 (16:45 -0500)]
Remove superfluous semicolons
Doesn't change the result of the test but it does prevent the
syntax tree from rendering.
bors[bot] [Thu, 7 Mar 2019 19:48:11 +0000 (19:48 +0000)]
Merge #952
952: Update some deps r=matklad a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Thu, 7 Mar 2019 19:42:34 +0000 (14:42 -0500)]
Update some deps
bors[bot] [Thu, 7 Mar 2019 19:03:09 +0000 (19:03 +0000)]
Merge #951
951: Fix EnumVariants not showing properly when hovering r=matklad a=vipentti
This fixes #950
This also fixes hovering over the name of an EnumVariant.
Additionally this changes the way enum variants are shown, now instead of the `Some<T>... -> Option` you just get `Some`. I'm not sure what would be the optimal display for enum variants in this case.
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Ville Penttinen [Thu, 7 Mar 2019 18:58:41 +0000 (20:58 +0200)]
Use ast::Name::text() instead of name().syntax().text()
Ville Penttinen [Thu, 7 Mar 2019 18:28:51 +0000 (20:28 +0200)]
Fix EnumVariants not showing properly when hovering
This fixes documentation as well for EnumVariants
bors[bot] [Thu, 7 Mar 2019 17:35:57 +0000 (17:35 +0000)]
Merge #948
948: Fix test_missing_module_code_action_in_json_project on Windows r=matklad a=vipentti
The test would fail on Windows due to the paths not being properly escaped for
JSON.
In addition adds extra braces around the fn main to actually introduce braces in
the file.
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Ville Penttinen [Thu, 7 Mar 2019 16:25:35 +0000 (18:25 +0200)]
Fix test_missing_module_code_action_in_json_project on Windows
The test would fail on Windows due to the paths not being properly escaped for
JSON.
In addition adds extra braces around the fn main to actually introduce braces in
the file.
bors[bot] [Thu, 7 Mar 2019 17:23:59 +0000 (17:23 +0000)]
Merge #949
949: Specify derive feature for serde r=matklad a=pcpthm
`ra_project_model` build will fail when no dependencies are using this feature. Reproduced by creating a crate depending on `ra_batch`.
Co-authored-by: pcpthm <pcpthm@gmail.com>
pcpthm [Thu, 7 Mar 2019 16:58:29 +0000 (01:58 +0900)]
Specify derive feature for serde
bors[bot] [Thu, 7 Mar 2019 16:10:36 +0000 (16:10 +0000)]
Merge #944
944: Add support for goto definition and hover on Self r=matklad a=vipentti
This fixes #943
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Ville Penttinen [Thu, 7 Mar 2019 08:32:39 +0000 (10:32 +0200)]
Add support for goto definition and hover on Self
This fixes #943
bors[bot] [Thu, 7 Mar 2019 14:48:37 +0000 (14:48 +0000)]
Merge #946
946: when loading workspace, say how many packages were loaded r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 7 Mar 2019 14:46:17 +0000 (17:46 +0300)]
when loading workspace, say how many packages were loaded
this should help to debug configuration issues, when you see `0
packages loaded` or something like that.
bors[bot] [Thu, 7 Mar 2019 11:36:04 +0000 (11:36 +0000)]
Merge #939
939: Initial implementation of project-lock.json. r=davidtwco a=davidtwco
Fixes #792.
This PR adds a initial implementation of project-lock.json, a build
system agnostic method of specifying the crate graph and roots.
Co-authored-by: David Wood <david@davidtw.co>
David Wood [Thu, 7 Mar 2019 11:28:19 +0000 (12:28 +0100)]
Remove rust-project.json test w/ dependencies.