Commit Graph

998 Commits

Author SHA1 Message Date
uHOOCCOOHu
5f48ef3902
Strip 2019-09-10 01:21:29 +08:00
uHOOCCOOHu
40f9134159
Make macro scope a real name scope
Fix some details about module scoping
2019-09-09 20:54:02 +08:00
uHOOCCOOHu
9ed21d65fb
Fix test 2019-09-09 01:34:53 +08:00
uHOOCCOOHu
92c07803cc
Rename textual_macro -> legacy_macro
Add comments
2019-09-09 01:34:53 +08:00
uHOOCCOOHu
f7f7c2aff8
Revert "Replace with immutable map to avoid heavy cloning"
This reverts commit 2c494eb803c88ef5d23607c3b156fce60c2b8076.

See: https://github.com/rust-analyzer/rust-analyzer/pull/1784#issuecomment-529119924
2019-09-09 01:34:53 +08:00
uHOOCCOOHu
c90256429b
Replace with immutable map to avoid heavy cloning 2019-09-09 01:34:53 +08:00
uHOOCCOOHu
26b092bd3b
Resolve textual scoped macros inside item 2019-09-09 01:34:53 +08:00
uHOOCCOOHu
e0f305a6bf
Support textual scoped macros 2019-09-09 01:33:28 +08:00
Aleksey Kladov
6021a2a83a cleanup hir db imports 2019-09-08 09:55:12 +03:00
Aleksey Kladov
bcc9a28734 don't cycle when processing macros from prelude in prelude 2019-09-07 21:47:59 +03:00
Florian Diebold
8fb3cab76c Fix crash for super trait cycles 2019-09-07 16:49:57 +02:00
Florian Diebold
9db34eec20 Fix Chalk environments
The clauses need to be wrapped in `FromEnv` clauses for elaboration (i.e.
things like inferring `T: Clone` from `T: Copy`) to work correctly.
2019-09-07 16:30:37 +02:00
Florian Diebold
a1776b27c7 Use traits from where clauses for method resolution
E.g. if we have `T: some::Trait`, we can call methods from that trait without it
needing to be in scope.
2019-09-07 16:30:31 +02:00
Florian Diebold
d21cdf3c99 Lower Fn(X, Y) -> Z paths 2019-09-07 15:13:05 +02:00
Florian Diebold
60bdb66ef2 Lower bounds on trait definition, and resolve assoc types from super traits 2019-09-07 14:31:43 +02:00
Florian Diebold
4ae4d9c311 Add some more tests 2019-09-07 13:35:41 +02:00
bors[bot]
007737a0e7
Merge #1779
1779: minor r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-06 11:33:37 +00:00
Aleksey Kladov
f477f2516a minor 2019-09-06 14:30:24 +03:00
Aleksey Kladov
9ae455ea52 make source_root API more abstract 2019-09-06 14:21:11 +03:00
bors[bot]
419eec3d2f
Merge #1771
1771: Further tweak for macro_use on extern crate r=matklad a=uHOOCCOOHu

Some more tweaks to #1743 to behave more like `rustc`
1. Hoist macros from `#[macro_use] extern crate`, so that they can be used before `extern crate`.
2. Implicit `#[macro_use]` for `prelude` if exists


Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
2019-09-05 19:50:06 +00:00
Aleksey Kladov
5a38a80d1a rename test file to match impl file 2019-09-05 21:43:32 +03:00
Aleksey Kladov
3e5f7299e1 move mod resolution to a separate file 2019-09-05 20:27:10 +03:00
uHOOCCOOHu
67d33cc21a
Hoist macros from extern crate with macro_use 2019-09-05 18:50:04 +08:00
uHOOCCOOHu
dec43a0c5d
Consider prelude to be macro_use 2019-09-05 18:50:04 +08:00
bors[bot]
6702f5b7b5
Merge #1743
1743: Support `#[macro_use]` on `extern crate` r=matklad a=uHOOCCOOHu

Unfortunately, #1688 is still an issue. My guess is wrong :(

Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
2019-09-05 09:04:02 +00:00
uHOOCCOOHu
3ff5d7e73c
Fix typo 2019-09-05 12:03:32 +08:00
uHOOCCOOHu
0d23286caf
Let macro_use bypass module scope 2019-09-05 11:46:00 +08:00
Florian Diebold
b8c1e402fa Make type walking infrastructure a bit nicer
If/when we switch to using Chalk's Ty, we'll need to replace this by its `Fold`
trait, but I didn't want to import the whole thing just yet.
2019-09-03 14:00:35 +02:00
Florian Diebold
c4fcfa2b0d Properly format impl Trait<Type = Foo> types
It's a bit complicated because we basically have to 'undo' the desugaring, and
the result is very dependent on the specifics of the desugaring and will
probably produce weird results otherwise.
2019-09-03 14:00:35 +02:00
Florian Diebold
741e350d4b Add support for associated type bindings (where Trait<Type = X>) 2019-09-03 14:00:35 +02:00
Florian Diebold
966ab9abd2 Add test for assoc type bindings 2019-09-03 13:25:29 +02:00
Aleksey Kladov
9c3b25177e Correctly build BodySourceMap for macro-expanded expressions 2019-09-03 11:04:38 +03:00
Aleksey Kladov
4b51c92fee slightly simplify expr lowering flow 2019-09-03 09:41:21 +03:00
Aleksey Kladov
da850361ba clearer ignore 2019-09-03 09:01:09 +03:00
Aleksey Kladov
82b218b7bf remove needless refs 2019-09-03 08:59:44 +03:00
Aleksey Kladov
48ffbf29b7 use recrod terminology for hir::Pat 2019-09-03 08:59:09 +03:00
Aleksey Kladov
db69d134fb move expr lowering to lower 2019-09-03 08:56:36 +03:00
Aleksey Kladov
5e3f291195 fix hir for new block syntax 2019-09-02 21:23:19 +03:00
Aleksey Kladov
f377b94628 remove useless trait 2019-09-02 19:45:41 +03:00
Florian Diebold
f92177cfb5 Add an expr_source method analogous to the source methods in the code model
... and use that instead of exposing the source map.
2019-09-02 14:56:38 +02:00
Florian Diebold
a7858bb7bf Report type mismatches in analysis-stats
Only the number usually; each one individually when running with -v.
2019-09-02 14:56:38 +02:00
uHOOCCOOHu
a66214b34e
Fix import strategy of macro_use and its test 2019-09-02 14:36:20 +08:00
Aleksey Kladov
4b6bccb58c ⬆️ once_cell 2019-09-01 23:18:15 +03:00
uHOOCCOOHu
dfa758f6a9
Add test 2019-09-01 02:03:33 +08:00
uHOOCCOOHu
f5bea9051b
Support resolution of #[macro_use] extern crate 2019-09-01 01:54:41 +08:00
Aleksey Kladov
0f6c048ce1 ⬆️ insta 2019-08-29 17:04:01 +03:00
Kirill Bulatov
4adfdea1ad Small fixes 2019-08-26 23:00:35 +03:00
Kirill Bulatov
590aed2eec Remove redundant tests 2019-08-26 23:00:27 +03:00
Florian Diebold
c256a72b03 Fix 'missing Ok in tail expr' validation
Because of the coercion change, the type mismatch now only happens on the block
expression.
2019-08-26 22:44:50 +03:00
Florian Diebold
e37b6c5837 Make infer_block not unify; add back calculate_least_upper_bound 2019-08-26 22:44:50 +03:00