Jonas Schievink
f8f44cfb9b
Fall back to parent DefMaps when resolving paths
2021-01-21 15:24:15 +01:00
Jonas Schievink
896dfacfc4
Add name resolution query for block expressions
2021-01-21 15:22:17 +01:00
Jonas Schievink
57a82fb05b
Rename CrateDefMap
to DefMap
2021-01-18 20:18:05 +01:00
Aleksey Kladov
4c4e54ac8a
prepare to publish el libro de arena
2021-01-14 19:06:02 +03:00
Vincent Esche
21f8239ac8
Fixed typos in code comments
2021-01-09 15:41:29 +01:00
Kevaundray Wedderburn
72b9a4fbd3
Change <|> to $0 - Rebase
2021-01-07 12:09:23 +00:00
Jonas Schievink
3cb7c8b548
Emit diagnostics for unresolved item-level macros
2021-01-05 15:42:43 +01:00
Edwin Cheng
877c251bef
Fixed old failed test due to new fixes
2020-12-28 20:08:50 +08:00
Aleksey Kladov
2c84c2d07a
Don't think that /submod.rs is /mod.rs
2020-12-23 11:02:42 +03:00
Jonas Schievink
aa00d1acd6
fixture -> ra_fixture
2020-12-19 01:12:41 +01:00
Jonas Schievink
d5edd0e928
Test paths to derive macros
2020-12-19 01:11:33 +01:00
Jonas Schievink
ea5cc8d07a
More accurate #[derive]
parsing
...
This now allows full paths to the derive macro
2020-12-19 01:10:56 +01:00
bors[bot]
38b108c20e
Merge #6935
...
6935: Don't look at attributes when lowering to ItemTree r=jonas-schievink a=jonas-schievink
Resolves 2 `cfg_attr` FIXMEs
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-12-18 19:38:07 +00:00
Jonas Schievink
77972e2001
Don't look at attributes when lowering to ItemTree
...
Resolves 2 `cfg_attr` FIXMEs
2020-12-18 20:37:26 +01:00
Jonas Schievink
aab9cc9cfb
Hit a mark
2020-12-18 20:25:41 +01:00
Jonas Schievink
382ee2fa03
Add test
2020-12-18 20:01:02 +01:00
Jonas Schievink
4f07d8dd58
Refactor attributes API to allow handling cfg_attr
2020-12-18 02:24:14 +01:00
Jonas Schievink
28b5334580
Avoid querying attributes in item tree lowering
...
ItemTree is per-file, so there is no unique crate associated with it.
This means that it cannot know the active CfgOptions and thus couldn't
handle `cfg_attr`.
Prepare it for `cfg_attr`s by avoiding accessing attributes.
2020-12-16 23:42:03 +01:00
Jonas Schievink
b238ddd21a
Make macro def krate mandatory
...
Refactors builtin derive support to go through proper name resolution
2020-12-15 20:33:05 +01:00
Jonas Schievink
c31c3246a8
Basic support for decl macros 2.0
2020-12-15 18:43:34 +01:00
Jonas Schievink
c1cb595382
Move to upstream macro_rules!
model
2020-12-15 15:37:37 +01:00
Aleksey Kladov
6e24321e45
Introduce anchored_path
...
They allow to represent paths like `#[path = "C:\path.rs"] mod foo;`
in a lossless cross-platform & network-transparent way.
2020-12-09 19:07:05 +03:00
Lukas Wirth
2facd9517f
Escape string literals in Attr::from_src
2020-12-08 13:47:58 +01:00
Lukas Wirth
7b456552b8
Don't discard PathKind::Abs information in lower_use::convert_path
2020-12-02 09:54:03 +01:00
Jonas Schievink
0432aa0ed7
Publish diagnostics for macro expansion errors
2020-11-27 13:50:22 +01:00
Jonas Schievink
519d870c11
Don't store SyntaxNodePtr
in CrateDefMap
...
It is volatile across reparses and makes incrementality worse.
2020-11-26 17:29:09 +01:00
Jonas Schievink
74cb3e96a5
Test def map invalidation with #[cfg] below change
2020-11-26 17:28:00 +01:00
Aleksey Kladov
2b108133ac
Don't stack overflow on circular modules
...
closes #6453
2020-11-04 15:31:35 +01:00
bors[bot]
8ad01d863b
Merge #6435
...
6435: Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot. r=matklad a=rickvanprim
Updates `module_resolution_relative_path_outside_root` test to check valid paths outside of the root, by moving the root to a subpath so that paths outside of it are possible. If this would be more appropriate as a new test, or if the original check for an invalid path should be left, I'm happy to update.
Co-authored-by: James Leitch <rickvanprim@gmail.com>
2020-11-03 16:36:34 +00:00
James Leitch
ff87726074
Feedback.
2020-11-02 10:57:31 -07:00
Aleksey Kladov
b610118453
Deny unreachable-pub
...
It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!
Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034 .
2020-11-02 14:07:08 +01:00
James Leitch
d2d7a4403c
Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot.
2020-11-01 17:20:55 -07:00
Jonas Schievink
cd3c632cfc
Handle #![cfg] in crate root
2020-10-26 16:04:08 +01:00
Jonas Schievink
93dc6f511b
Diagnose #[cfg]s in bodies
2020-10-23 19:27:04 +02:00
Jonas Schievink
3421b645e6
Emit better #[cfg] diagnostics
2020-10-22 19:19:18 +02:00
Jonas Schievink
80d2741401
Add a (hint) diagnostic for unconfigured items
2020-10-20 17:53:04 +02:00
Jonas Schievink
8ab7696acd
Account for proc macro helpers when parsing attr
2020-10-05 23:41:16 +02:00
Jonas Schievink
e88e4fbb7b
Add more comments about proc macro resolution
2020-09-28 13:02:28 +02:00
Jonas Schievink
baab72e611
Reduce visibility of non-proc-macros
...
proc-macro crates only export proc-macros, but currently other items
are also considered public (and show up in completion)
2020-09-18 17:50:04 +02:00
Jonas Schievink
069045015c
Remove obsolete proc macro collection code
...
The new attribute-based resolution takes care of this
2020-09-18 16:52:24 +02:00
Jonas Schievink
5486b70bc0
Use hir_def to resolve proc macros
2020-09-18 16:43:50 +02:00
Jonas Schievink
dfa3a3f017
Add test
2020-09-18 16:37:12 +02:00
Jonas Schievink
9dc0afe854
Rename CustomDerive
to ProcMacro
...
It handles fn-like macros too, and will handle attribute macros in the
future
2020-09-18 15:37:31 +02:00
Jonas Schievink
700a3d5d75
Invert condition to unindent code
2020-09-18 12:32:07 +02:00
Jonas Schievink
6eea06415d
Give ExternCrate
a Name
, not a ModPath
2020-09-17 15:28:23 +02:00
Jonas Schievink
0dca7acf0f
Don't diagnose imports whose base crate is missing
2020-09-17 14:48:17 +02:00
Jonas Schievink
f792bc7ddd
Add annotation-based nameres diagnostic tests
2020-09-16 17:26:51 +02:00
Jonas Schievink
4785162b08
Track import sources and emit diagnostics
2020-09-16 17:26:51 +02:00
Jonas Schievink
4ac9a2e5d3
Leave extern crate items unresolved if they are
2020-09-16 17:26:51 +02:00
Jonas Schievink
2a9a66d254
Add diagnostic types for unresolved crates/imports
2020-09-16 17:26:51 +02:00
Jonas Schievink
f3ac19e8cd
Support extern types
2020-08-24 22:02:55 +02:00
Aleksey Kladov
b0fd3faf36
Switch to expect_test from crates.io
2020-08-21 13:19:31 +02:00
Aleksey Kladov
b28c54a2c2
Rename ra_hir_def -> hir_def
2020-08-13 16:29:33 +02:00