jDomantas
a565a42f46
format
2020-08-17 11:36:46 +03:00
jDomantas
38e3088a56
update generated tests
2020-08-17 10:47:13 +03:00
bors[bot]
0b2b9a5508
Merge #5766
...
5766: Hacky support for fn-like proc macros r=matklad a=jonas-schievink
It turns out that this is all that's needed to get something like this working:
```rust
#[proc_macro]
pub fn function_like_macro(_args: TokenStream) -> TokenStream {
TokenStream::from_str("fn fn_success() {}").unwrap()
}
```
```rust
function_like_macro!();
fn f() {
fn_success();
}
```
The drawback is that it also makes this work, because there is no distinction between different proc macro kinds in the rest of r-a:
```rust
#[derive(function_like_macro)]
struct S {}
fn f() {
fn_success();
}
```
Another issue is that it seems to panic, and then panic, when using this on the rustc code base, due to some issue in the inscrutable proc macro bridge code.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-08-16 20:03:06 +00:00
Jeremy Kolb
409090e74c
Chalk 0.23
2020-08-16 12:15:44 -04:00
Jeremy Kolb
7819e794db
Bump rustc_lexer
2020-08-16 11:57:10 -04:00
Yusuke Tanaka
e8e1eb4263
Remove test for handle_document_symbol
2020-08-17 00:19:29 +09:00
Paul Daniel Faria
3456e2eec7
Add new method to Semantics, method_receiver_kind, which returns the kind of self
...
The options are Shared, Mutable, Consuming, and Copied. Use this to add proper
highlighting to methods based on usage.
2020-08-16 10:26:16 -04:00
Paul Daniel Faria
a044ff0138
Mark mutating functions with mutable
modifier, and owning functions with consuming
.
2020-08-16 10:22:51 -04:00
Paul Daniel Faria
7009d5ee2b
Add new HighlightModifier variant, Consuming
2020-08-16 10:22:51 -04:00
Dave Lage
d31634940d
Fix typo in comment
2020-08-15 16:37:44 -04:00
Aleksey Kladov
0ca1ba29e8
Don't expose hir::Path out of hir
...
Conjecture: it's impossible to use hir::Path *correctly* from an IDE.
I am not entirely sure about this, and we might need to add it back at
some point, but I have to arguments that convince me that we probably
won't:
* `hir::Path` has to know about hygiene, which an IDE can't set up
properly.
* `hir::Path` lacks identity, but you actually have to know identity
to resolve it correctly
2020-08-15 18:50:41 +02:00
Aleksey Kladov
2052d33b9b
Remove deprecated Path::from_ast
...
Long term, we probably should make hir::Path private to hir.
2020-08-15 18:22:16 +02:00
Jonas Schievink
bee56e68a3
Hacky support for fn-like proc macros
2020-08-15 15:34:56 +02:00
Jonas Schievink
cb816b1ea8
Add a proc_macro_test crate
...
This exports all 3 kinds of proc macros and is useful for testing
2020-08-15 00:27:32 +02:00
Dmitry
73315c9168
synchronizing changes
2020-08-15 02:37:43 +07:00
Dmitry
178c3e135a
Merge remote-tracking branch 'origin/master'
2020-08-15 01:32:05 +07:00
Dmitry
06ff8e6c76
refactor requirements put forward mkladov
2020-08-15 01:25:08 +07:00
bors[bot]
c2594daf29
Merge #5347
...
5347: Chalk writer integration r=flodiebold a=detrumi
~~This adds a `rust-analyzer dump-chalk` command, similar to analysis-stats, which writes out the whole chalk progam (see [chalk#365](https://github.com/rust-lang/chalk/issues/365 ) for more info about the .chalk writer)~~
Write out chalk programs in debug output if chalk debugging is active (using `CHALK_DEBUG`).
Example output:
```
[DEBUG ra_hir_ty::traits] solve(UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: Implemented(SeparatorTraitRef(?)) }, binders: [] }, universes: 1 }) => None
[INFO ra_hir_ty::traits] trait_solve_query(Implements(fn min<?0.0>(?0.0, ?0.0) -> ?0.0: Deref))
[DEBUG ra_hir_ty::traits] solve goal: UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: Implemented(SeparatorTraitRef(?)) }, binders: [U0 with kind type] }, universes: 1 }
[DEBUG ra_hir_ty::traits::chalk] impls_for_trait Deref
[DEBUG ra_hir_ty::traits::chalk] impls_for_trait returned 0 impls
[DEBUG ra_hir_ty::traits::chalk] trait_datum Ord
[DEBUG ra_hir_ty::traits::chalk] trait Ord = Name(Text("Ord"))
[DEBUG ra_hir_ty::traits] chalk program:
#[upstream]
#[non_enumerable]
#[object_safe]
trait Ord {}
#[upstream]
#[non_enumerable]
#[object_safe]
#[lang(sized)]
trait Sized {}
fn fn_0<_1_0>(arg_0: _1_0, arg_1: _1_0) -> _1_0
where
_1_0: Ord;
#[upstream]
#[non_enumerable]
#[object_safe]
trait Deref {
type Assoc_1829: Sized;
}
[DEBUG ra_hir_ty::traits] solve(UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: Implemented(SeparatorTraitRef(?)) }, binders: [U0 with kind type] }, universes: 1 }) => None
[INFO ra_hir_ty::traits] trait_solve_query(Implements(?0.0: Ord))
```
Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2020-08-14 17:02:55 +00:00
Dmitry
e7899625e6
restrict visibility only by crate
2020-08-14 23:22:23 +07:00
Dmitry
c8a6ecc075
Revert "replase sparse-checkout by github api"
...
This reverts commit 034db28c542c04b22147da6722328bc74ff99386.
2020-08-14 23:09:47 +07:00
Dmitry
034db28c54
replase sparse-checkout by github api
2020-08-14 21:58:04 +07:00
Aleksey Kladov
125744c057
Rename hypothetical -> speculative
2020-08-14 15:23:27 +02:00
jDomantas
9f548a0295
fixup whitespace when adding missing impl items
2020-08-14 16:10:52 +03:00
Wilco Kusee
de282ddd86
Only print chalk programs with CHALK_PRINT
2020-08-14 14:52:07 +02:00
David Lattimore
a4a504e132
SSR: Explicitly autoderef and ref placeholders as needed
...
Structured search replace now inserts *, & and &mut in the replacement to match any auto[de]ref in the matched code.
2020-08-14 21:26:25 +10:00
David Lattimore
c84f98385a
Refactor SSR so that placeholders store a Var
...
This allows lookup of placeholder bindings given a placeholder without
needing to create a Var instance.
2020-08-14 20:12:26 +10:00
Wilco Kusee
36052ce1a1
Lookup adt names
2020-08-14 11:43:11 +02:00
Wilco Kusee
10c33275b0
Only use logging db if CHALK_DEBUG is active
2020-08-14 11:43:10 +02:00
Wilco Kusee
58e338a729
Print chalk programs in debug output
2020-08-14 11:43:10 +02:00
Igor Aleksanov
c26c911ec1
Merge branch 'master' into add-disable-diagnostics
2020-08-14 07:34:07 +03:00
Armin Sander
8fc254597f
Sophisticate Windows path encoding
2020-08-14 02:03:54 +02:00
Aleksey Kladov
9664c57e60
Make hygiene private to hir
2020-08-13 23:54:37 +02:00
bors[bot]
9930ef2536
Merge #5753
...
5753: Remove Hygiene from completion
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-13 20:42:36 +00:00
Aleksey Kladov
86f89d9b31
Remove Hygiene from completion
2020-08-13 22:41:55 +02:00
Benjamin Coenen
947a27b797
display correctly 'impl Trait<T> + Trait<T>' #4814
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-08-13 22:13:34 +02:00
Aleksey Kladov
ef462ed6af
Better recovery in use foo::;
2020-08-13 18:50:21 +02:00
Aleksey Kladov
0e1cda3079
Minor
2020-08-13 18:17:53 +02:00
Aleksey Kladov
6bc2633c90
Align parser names with grammar
2020-08-13 17:59:27 +02:00
Aleksey Kladov
1b0c7701cc
Rename ra_ide -> ide
2020-08-13 17:58:27 +02:00
Aleksey Kladov
fc34403018
Rename ra_assists -> assists
2020-08-13 17:33:38 +02:00
Aleksey Kladov
ae3abd6e57
Rename ra_ssr -> ssr
2020-08-13 17:02:44 +02:00
Aleksey Kladov
bb5c189b7d
Rename ra_ide_db -> ide_db
2020-08-13 16:39:16 +02:00
Aleksey Kladov
ae71a631fd
Rename ra_hir -> hir
2020-08-13 16:36:55 +02:00
Aleksey Kladov
6a77ec7bbe
Rename ra_hir_ty -> hir_ty
2020-08-13 16:35:29 +02:00
Aleksey Kladov
b28c54a2c2
Rename ra_hir_def -> hir_def
2020-08-13 16:29:33 +02:00
Aleksey Kladov
b7aa4898e0
Rename ra_hir_expand -> hir_expand
2020-08-13 16:29:33 +02:00
Aleksey Kladov
ed20a857f4
Rename ra_db -> base_db
2020-08-13 16:29:33 +02:00
bors[bot]
902f74c269
Merge #5746
...
5746: Structured search replace now handles UFCS calls to trait methods r=matklad a=davidlattimore
Co-authored-by: David Lattimore <dml@google.com>
2020-08-13 14:21:35 +00:00
Aleksey Kladov
2119dc23e8
Rename ra_proc_macro -> proc_macro_api
2020-08-13 12:39:27 +02:00
David Lattimore
3100de842b
Structured search replace now handles UFCS calls to trait methods
2020-08-13 20:24:55 +10:00