Aleksey Kladov
bcf45371ff
make macro expansion into a proper query
2019-05-04 18:01:43 +03:00
Aleksey Kladov
87a1e276d5
minor, move
2019-05-04 17:42:24 +03:00
Aleksey Kladov
5dc384132f
introduce macro_arg intermediate query
...
Currently, when expanding macros, we look at the source code
directly (we invoke ast_id_to_node query via to_node method).
This is less then ideal, because it make us re-expand macros after
every source change.
This commit establishes a salsa-firewall: a query to get macro call's
token tree. Unlike the syntax tree, token tree changes only if we
actually modify the macro itself.
2019-05-04 17:38:09 +03:00
Aleksey Kladov
8876f44054
Revert "eagarly clean astd maps"
...
This reverts commit 6c63a59425
.
This causes massive slowdowns: looks like we accidentally have some source-depndent
2019-05-04 16:04:34 +03:00
Aleksey Kladov
6c63a59425
eagarly clean astd maps
2019-05-04 11:53:44 +03:00
Aleksey Kladov
594aac059e
Use correct FileId when expanding macros in expressions
2019-05-01 15:53:13 +03:00
Felix S. Klock II
d694b0174a
Sidestep two-phase borrow violation signaled by mutable_borrow_reservation_conflict.
...
See rust-lang/rust#59159 for further information/discussion.
2019-04-29 14:03:51 +02:00
Edwin Cheng
dfab545d5d
Add more information on macro rules fail to parse
2019-04-26 02:03:55 +08:00
Aleksey Kladov
848cb16a01
drop empty file
2019-04-25 10:07:23 +03:00
Lenard Pratt
1ab7066e32
Introduced resolve_macro_call on resolver
...
changed to manual expansion
fix for nested macros
2019-04-23 10:17:31 +01:00
Lenard Pratt
ce211434a6
Added macro resolution and expansion
2019-04-22 21:35:44 +01:00
Lenard Pratt
afaeb18910
Addeded resolver and db
2019-04-22 21:33:48 +01:00
bors[bot]
c416caeda2
Merge #1194
...
1194: Pr 1190 r=matklad a=matklad
Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-04-22 13:19:47 +00:00
Aleksey Kladov
aa1ef6ae9a
unused import
2019-04-22 16:18:14 +03:00
Aleksey Kladov
e01052d1f0
move auto-imoprter into IDE
...
auto-import is purely an IDE concern, so it should be done outside of
HIR
2019-04-22 15:56:28 +03:00
Edwin Cheng
d6d9aa2003
Change macro stack monitor test to func ptr based
2019-04-22 17:15:22 +08:00
Edwin Cheng
b177813f3b
Add mbe expand limit and poision macro set
2019-04-22 15:33:55 +08:00
Andrea Pretto
200032852b
complete_import: prevent panic when the anchor is the completion source range
...
(fix rebase mess)
Please enter the commit message for your changes. Lines starting
2019-04-22 00:48:43 +02:00
Andrea Pretto
9144214958
complete_import: add new import resolver infrastructure with some hardcoded importable name.
...
Changes complete_scope to support that.
2019-04-22 00:14:58 +02:00
Andrea Pretto
766813898f
auto_import: make auto import working with target as a list of SmolStr instead of ast::Path
2019-04-22 00:13:00 +02:00
Edwin Cheng
9a5b9638c1
Add more information on parse_macro fail
2019-04-22 05:04:37 +08:00
Florian Diebold
787fb3e5ec
Add HIR for where clauses & ignore impls with where clauses in trait resolution
...
This prevents any `impl<T> Trait for T where ...` from being treated as a
blanket impl while we don't handle where clauses yet.
2019-04-21 15:01:17 +02:00
bors[bot]
fa15c4d75e
Merge #1175
...
1175: Fix bugs and add error log about macro expansion r=matklad a=edwin0cheng
This PR fixed / add following things:
* Add a fused count which stop recursion of macro expansion in name resolution.
* Add some logs when macro expansion fails
* Add `$crate` meta variable support in mbe, which create a `$crate` ident token in token tree.
* Fixed matching a `$REPEAT` pattern inside a subtree, e.g. `(fn $name:ident {$($i:ident)*} ) => {...}`
* Remove composite-able punct token in syntax node to token conversion.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-04-21 10:34:07 +00:00
Florian Diebold
82751f8a4a
Add a simple test for str method completion
2019-04-20 18:26:53 +02:00
Edwin Cheng
9e35bf91b8
Fix bugs
2019-04-20 23:53:39 +08:00
Marco Groppo
8ac3d1f9aa
lang_item_lookup is now a salsa query.
2019-04-20 00:29:16 +02:00
Marco Groppo
8ebb20edce
New krate() method in Resolver.
...
Renamed Impl to ImplBlock.
2019-04-20 00:20:26 +02:00
Marco Groppo
e85ee60c42
Initial support for lang items.
2019-04-20 00:10:19 +02:00
Edwin Cheng
8747c903a2
Refactoring
2019-04-17 09:35:03 +08:00
Edwin Cheng
039ab2e820
Simpliy code
2019-04-17 09:31:53 +08:00
Edwin Cheng
0edb5ce97a
Bug fix and add more comments
2019-04-17 09:31:52 +08:00
Edwin Cheng
180655077a
Fix 1099
2019-04-17 09:31:52 +08:00
Florian Diebold
4f8a49f43c
Refactor method candidate generation a bit
...
This fixes the order in which candidates are chosen a bit (not completely
though, as the ignored test demonstrates), and makes autoderef work with trait
methods. As a side effect, this also makes completion of trait methods work :)
2019-04-14 21:53:35 +02:00
Florian Diebold
8bcbcc454c
Extract generic_params method to a HasGenericParams trait
2019-04-14 13:07:45 +02:00
Florian Diebold
4497e1d3ea
Add Container enum to handle both kinds of container (impl/trait)
2019-04-14 11:28:53 +02:00
Florian Diebold
7650a44640
Make callable signature handling a bit nicer
2019-04-14 11:28:53 +02:00
Florian Diebold
9339241b78
Some cleanup
2019-04-14 11:28:53 +02:00
Florian Diebold
a1ed53a4f1
More trait infrastructure
...
- make it possible to get parent trait from method
- add 'obligation' machinery for checking that a type implements a
trait (and inferring facts about type variables from that)
- handle type parameters of traits (to a certain degree)
- improve the hacky implements check to cover enough cases to exercise the
handling of traits with type parameters
- basic canonicalization (will probably also be done by Chalk)
2019-04-14 11:28:53 +02:00
Florian Diebold
413c87f155
Get substs for trait refs in impl blocks
2019-04-14 11:28:53 +02:00
Robin Freyler
6aae0cf7fa
replace usages of algo::generate
with iter::successors
from std
2019-04-13 16:43:49 +02:00
Aleksey Kladov
2facb5e061
cleanups
2019-04-13 14:16:46 +03:00
Aleksey Kladov
b260641e0c
slight encapsulation
2019-04-13 11:29:47 +03:00
Aleksey Kladov
f9e825d956
move ScopeEntryWithSyntax
2019-04-13 11:24:09 +03:00
Aleksey Kladov
d387bdccba
drop obsolete fixme
2019-04-13 11:21:32 +03:00
Aleksey Kladov
4f8dc1b9f0
make expr scope stuff private
2019-04-13 11:06:53 +03:00
Aleksey Kladov
a2cc76ce63
make resolver private
2019-04-13 11:03:02 +03:00
Aleksey Kladov
62d01dd4df
hide resolver
2019-04-13 11:00:15 +03:00
Aleksey Kladov
f4a94e74bc
fold ScopeWithSyntax into SourceAnalyzer
2019-04-13 10:49:01 +03:00
Aleksey Kladov
30481808fb
make stuff private
2019-04-13 09:53:02 +03:00
Aleksey Kladov
1e8569dce9
make private
2019-04-13 09:46:39 +03:00