Commit graph

1091 commits

Author SHA1 Message Date
Ekaterina Babshukova
aa2f58550a add module methods 2019-10-09 14:59:47 +03:00
Aleksey Kladov
d9f83d9b16 add <> for type aliases as well 2019-10-09 11:53:32 +03:00
Aleksey Kladov
5144f3b22f refactor 2019-10-08 20:33:43 +03:00
bors[bot]
06a8deae4a
Merge #1969
1969: restore coloring of attributes r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-08 11:55:27 +00:00
Aleksey Kladov
972079c0e3 macro DSL for cfg in tests 2019-10-08 14:39:44 +03:00
ice1000
b043358be9 Address comments: fix docs, add completion test for Self. 2019-10-08 07:32:41 -04:00
Aleksey Kladov
355419d404 use slightly more idiomatic api for cfg 2019-10-08 14:22:49 +03:00
ice1000
6bad638928 Support inferring Self type in enum definitions
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
2019-10-07 19:40:14 -04:00
bors[bot]
ae6305b90c
Merge #1928
1928: Support `#[cfg(..)]` r=matklad a=oxalica

This PR implement `#[cfg(..)]` conditional compilation. It read default cfg options from `rustc --print cfg` with also hard-coded `test` and `debug_assertion` enabled.
Front-end settings are **not** included in this PR.

There is also a known issue that inner control attributes are totally ignored. I think it is **not** a part of `cfg` and create a separated issue for it. #1949

Fixes #1920 

Related: #1073 


Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
Co-authored-by: oxalica <oxalicc@pm.me>
2019-10-05 14:25:59 +00:00
uHOOCCOOHu
b271cb18d5
Add docs 2019-10-03 02:50:22 +08:00
uHOOCCOOHu
e0100e63ae
Optimize 2019-10-03 02:28:03 +08:00
uHOOCCOOHu
43f09ad36c
Refactor CfgOptions inside 2019-10-03 02:28:02 +08:00
uHOOCCOOHu
a49ad47e5a
Support cfg attribute on impl blocks 2019-10-03 02:28:02 +08:00
uHOOCCOOHu
d2ea776b8f
Enable CfgOptions test for workspace crates 2019-10-03 02:28:02 +08:00
uHOOCCOOHu
b1ed887d81
Introduce ra_cfg to parse and evaluate CfgExpr 2019-10-03 02:28:02 +08:00
uHOOCCOOHu
ffe179a736
Pass attributes as token tree to DefCollector 2019-10-03 02:27:11 +08:00
Laurențiu Nicola
f491567fb3 Handle divergence in type inference for blocks 2019-10-02 17:31:34 +03:00
Alexander Andreev
81efd696cc Merge branch 'master' into feature/issue/1856
# Conflicts:
#	crates/ra_assists/src/ast_editor.rs
2019-09-30 12:07:26 +03:00
Alexander Andreev
fdbd6bb11a Added test for check doc strings in crates.
#1856
2019-09-30 11:58:53 +03:00
uHOOCCOOHu
5a4b4f507e
Fix API of Attr 2019-09-30 16:17:53 +08:00
Aleksey Kladov
e60677178e correctly reset chalk state after a panic 2019-09-28 18:49:00 +03:00
Aleksey Kladov
35f1655b0b replace horrible hack with a slightly less horrible one 2019-09-27 20:47:36 +03:00
bors[bot]
2b69c84396
Merge #1815
1815: Support correct `$crate` expansion in macros r=uHOOCCOOHu a=uHOOCCOOHu

This PR makes normal use cases of `$crate` from macros work as expected.

It makes more macros from `std` work. Type inference works well with `panic`, `unimplemented`, `format`, and maybe more.
Sadly that `vec![1, 2, 3]` still not works, but it is not longer an issue about macro.

Screenshot:
![Screenshot_20190927_022136](https://user-images.githubusercontent.com/14816024/65714465-b4568f80-e0cd-11e9-8043-dd44c2ae8040.png)




Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
2019-09-27 02:58:26 +00:00
uHOOCCOOHu
edadeb95be
Fix 2019-09-27 10:55:25 +08:00
Florian Diebold
daaf46177e Add SubstsBuilder
+ further refactoring.
2019-09-26 23:03:39 +02:00
uHOOCCOOHu
2ecb126f5c
Support $crate in item and expr place. 2019-09-27 02:05:06 +08:00
uHOOCCOOHu
8cd23a4fb8
Store crate info in MacroDefId 2019-09-27 02:05:06 +08:00
uHOOCCOOHu
128dc5355b
Refactor Name ready for hygienic macro 2019-09-27 02:04:47 +08:00
uHOOCCOOHu
29e56b8ee4
Support all coercion places 2019-09-26 06:16:58 +08:00
uHOOCCOOHu
5807e261c2
Support custom CoerceUnsized
Split out tests about coercion
2019-09-26 06:16:52 +08:00
uHOOCCOOHu
bf161fa3e5
Better handle never type and branch merging
Split out tests for never type to another file
2019-09-26 06:04:43 +08:00
uHOOCCOOHu
4bb66df6de
Support basic implicit type coerce 2019-09-26 06:04:39 +08:00
uHOOCCOOHu
5205c84ec7
Support auto-deref in argument position 2019-09-26 06:02:04 +08:00
Florian Diebold
c35ef5013c Resolve trait associated items
E.g. `Default::default` or `<Foo as Default>::default`.
2019-09-25 21:41:17 +02:00
Florian Diebold
d0d1a202d4 Fix retrieval of the Fn traits
I used the wrong query, so it only used the lang items from the respective
crate...
2019-09-25 20:04:37 +02:00
bors[bot]
63433ba79a
Merge #1906
1906: Add missing lang-items to `def_crates` r=matklad a=sinkuu



Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2019-09-25 08:55:32 +00:00
Shotaro Yamada
89d0ff1623 Add missing lang-items to def_crates 2019-09-25 12:02:53 +09:00
Shotaro Yamada
9c45a9e586 Remove redundant clone() 2019-09-25 10:32:01 +09:00
Shotaro Yamada
7e0fa71532 Avoid intermediate allocation 2019-09-25 10:30:33 +09:00
Florian Diebold
6a86706650 Implement the call argument checking order hack for closures 2019-09-24 23:05:12 +02:00
Florian Diebold
a0aeb6e7ad Make the closure_1 test work 2019-09-24 23:05:12 +02:00
Florian Diebold
3b06faad26 Make closures impl closure traits 2019-09-24 23:05:12 +02:00
Florian Diebold
619a8185a6 Give closures types 2019-09-24 23:05:12 +02:00
Florian Diebold
7bb6fdcf52 Upgrade Chalk again 2019-09-24 22:29:52 +02:00
bors[bot]
c12a713739
Merge #1898
1898: Drive by lints r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-09-23 18:47:14 +00:00
Florian Diebold
6df9c4035a Upgrade Chalk 2019-09-23 20:36:15 +02:00
kjeremy
1808175f98 Drive by lints 2019-09-23 14:31:30 -04:00
Florian Diebold
4f1afe77b9 Split off path expression inference code into submodule 2019-09-23 18:53:52 +02:00
Florian Diebold
bc905d202c Handle projection types from Chalk 2019-09-22 20:08:46 +02:00
Florian Diebold
18bf278c25 Handle associated type shorthand (T::Item)
This is only allowed for generic parameters (including `Self` in traits), and
special care needs to be taken to not run into cycles while resolving it,
because we use the where clauses of the generic parameter to find candidates for
the trait containing the associated type, but the where clauses may themselves
contain instances of short-hand associated types.

In some cases this is even fine, e.g. we might have `T: Trait<U::Item>, U:
Iterator`. If there is a cycle, we'll currently panic, which isn't great, but
better than overflowing the stack...
2019-09-22 20:02:32 +02:00