Aleksey Kladov
260ae2dbc9
minor cleanup
2019-10-16 13:26:02 +03:00
bors[bot]
8e3864fd58
Merge #2008
...
2008: Prepare SourceDatabase API for lazy file loading r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-14 13:26:42 +00:00
Aleksey Kladov
abf2179c0b
Prepare SourceDatabase API for lazy file loading
2019-10-14 16:23:55 +03:00
bors[bot]
e182825170
Merge #2006
...
2006: Improvements around `Arc<[T]>` r=matklad a=sinkuu
First commit tries to avoid cloning `Arc<[T]>` to a temporary `Vec` for mutating it, if there are no other strong references. Second commit utilizes [`FromIterator for Arc<[T]>`](https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-FromIterator%3CT%3E ) instead of `.collect::<Vec<_>>().into()` to avoid allocation in `From<Vec<T>> for Arc<[T]>`.
Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2019-10-14 13:14:18 +00:00
Aleksey Kladov
1555a1aa0d
remove one more dependency on source roots
2019-10-14 15:15:47 +03:00
Shotaro Yamada
3a55b5bf01
make_mut_slice
2019-10-14 19:50:12 +09:00
Shotaro Yamada
b462eb96b8
import make_mut_arc_slice
2019-10-14 17:21:38 +09:00
Shotaro Yamada
965ca0d271
.collect()
directly into Arc<[T]>
2019-10-14 14:25:05 +09:00
Shotaro Yamada
f8d4cdc170
Avoid cloning Arc<[T]>
into a vec if possible
2019-10-14 14:25:05 +09:00
Florian Diebold
2955fbc7e1
Split up infer.rs further
...
- coercion logic goes to `coerce.rs`
- expression inference goes to `expr.rs`
- pattern inference goes to `pat.rs`
2019-10-12 18:41:11 +02:00
bors[bot]
0896ca04c4
Merge #1989
...
1989: Chalk update to simplified IR r=flodiebold a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-10-11 11:12:27 +00:00
bors[bot]
f70c54ccfb
Merge #1994
...
1994: remove last traces of source roots from hir r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-10-11 07:49:39 +00:00
Aleksey Kladov
e44c7ce200
remove last traces of source roots from hir
2019-10-11 10:48:46 +03:00
Shotaro Yamada
0d0a444d43
Remove as_original_file
2019-10-11 06:53:43 +09:00
kjeremy
4ba2c5b2de
Chalk update to simplified IR
2019-10-10 14:51:50 -04:00
Aleksey Kladov
29e83988be
don't special case macro_use
2019-10-10 17:48:30 +03:00
Aleksey Kladov
89826a50fc
don't special case path attr
2019-10-10 17:42:29 +03:00
Aleksey Kladov
b36b8970cc
simplify a bit
2019-10-10 17:23:01 +03:00
Aleksey Kladov
5140283277
simplify some tests
2019-10-10 14:51:35 +03:00
Aleksey Kladov
ce0d4a3b1d
Refactor and fix some more edge cases around name resolution
2019-10-10 14:46:14 +03:00
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