Lukas Wirth
af50e8d955
Fix box pattern inference panic
2021-03-21 18:25:00 +01:00
Yilin Chen
3bb9efb6b7
use the included file as the source of expanded include macro
...
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2021-03-21 23:02:01 +08:00
Florian Diebold
d8f8b495ad
Ignore type bindings in generic_predicates_for_param
...
This allows us to handle more cases without a query cycle, which
includes certain cases that rustc accepted. That in turn means we avoid
triggering salsa-rs/salsa#257 on valid code (it will still happen if the
user writes an actual cycle).
We actually accept more definitions than rustc now; that's because rustc
only ignores bindings when looking up super traits, whereas we now also
ignore them when looking for predicates to disambiguate associated type
shorthand. We could introduce a separate query for super traits if
necessary, but for now I think this should be fine.
2021-03-21 15:29:03 +01:00
Florian Diebold
0623bb4d71
Test for a Salsa bug
2021-03-21 13:33:06 +01:00
cynecx
42abfa0f88
hir_ty: add coverage testing for autoderef_visibility_method test
2021-03-20 20:35:57 +01:00
cynecx
2dc85f739a
hir_ty: fix test by removing trailing whitespace
2021-03-20 19:58:00 +01:00
cynecx
66d295d72d
hir_ty: fix visibility in infer_inherent_method test
2021-03-20 19:47:14 +01:00
cynecx
edfd741c5b
hir_ty: add tests around autoderef with visibility checking
2021-03-20 17:26:18 +01:00
cynecx
15e4aae823
hir_ty: fix tests by making required methods public
2021-03-20 17:12:49 +01:00
Florian Diebold
8e7e405f6a
Remove WhereClause::Error
...
Chalk doesn't have it, and judging from the removed code, it wasn't
useful anyway.
2021-03-20 10:51:00 +01:00
bors[bot]
d3da042a62
Merge #8082
...
8082: Proper handle inner recursive macro rules cases r=edwin0cheng a=edwin0cheng
Fixes #7645
cc @jonas-schievink
bors r+
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-18 12:25:44 +00:00
Edwin Cheng
13f30e9ef5
Handle inner recursive macro rules cases
2021-03-18 20:19:15 +08:00
Jonas Schievink
94b3b32c98
Support #[cfg]
on all associated items
2021-03-18 01:28:55 +01:00
Jonas Schievink
a85b32abdc
Add test for self-calling inner function
2021-03-17 22:30:09 +01:00
Edwin Cheng
8e07b23b84
Fix macro expansion for statements w/o semicolon
2021-03-16 13:44:50 +08:00
Florian Diebold
287e9a870c
Fix unification logic
2021-03-15 19:14:10 +01:00
Jonas Schievink
12f6bdcfd9
Check ancestor maps when computing traits in scope
2021-03-09 18:27:23 +01:00
Laurențiu Nicola
fc9eed4836
Use upstream cov-mark
2021-03-08 22:19:44 +02:00
cynecx
2cdd1ff1b5
hir_ty: use default type generic for box expressions
2021-02-28 21:18:30 +01:00
Laurențiu Nicola
d03cfe141c
Add test from #7273
2021-02-21 19:22:14 +02:00
Lukas Wirth
0799288f01
Don't write trailing whitespace when formatting empty GenericPredicates
2021-02-20 20:43:04 +01:00
Lukas Wirth
9e5192d917
Don't lower TypeBound::Lifetime as GenericPredicate::Error
2021-02-20 19:08:20 +01:00
Jonas Schievink
925c51aef3
Add test for #1165
...
Closes #1165
2021-02-10 18:42:35 +01:00
Jonas Schievink
2382dce2d3
Slightly expand test
2021-02-10 17:37:15 +01:00
Jonas Schievink
3c5734712a
Add more tests
2021-02-10 15:59:20 +01:00
Jonas Schievink
244d8e37f1
Update fixed tests
2021-02-10 14:48:52 +01:00
Jonas Schievink
e837df8479
infer: update resolver when descending into block
2021-02-10 14:41:54 +01:00
Aleksey Kladov
4b1279d0b1
Infra for "unit" benchmarking
2021-02-09 20:25:39 +03:00
Lukas Wirth
965d31ce5b
Check for dyn impls in method resolution
2021-02-08 19:13:54 +01:00
Thiébaud Weksteen
be0691b02b
Handle box with allocator
...
In 1.49.0, the definition of Box was modified to support an optional
Allocator[1]. Adapt the parsing of the `box` keyword to supply the
expected number of parameters to the constructor.
[1] f288cd2e17
2021-01-22 13:50:23 +01:00
Lukas Wirth
3d6480bc31
Render Fn* trait objects and impl types as rust does
2021-01-13 13:29:47 +01:00
Edwin Cheng
76f2b9d2ef
Proper handling $crate Take 2
2021-01-07 13:08:32 +08:00
Jonas Schievink
85cc3cfec9
Revert "Proper handling $crate and local_inner_macros"
2021-01-03 11:47:57 +01:00
Edwin Cheng
26b9c793f1
Fixed nested eager macro bug
2021-01-03 17:56:59 +08:00
bors[bot]
a88d4f8c72
Merge #7133
...
7133: Proper handling $crate and local_inner_macros r=jonas-schievink a=edwin0cheng
This PR introduces `HygineFrames` to store the macro definition/call site hierarchy in hyginee and when resolving `local_inner_macros` and `$crate`, we use the token to look up the corresponding frame and return the correct value.
See also: https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies
fixe #6890 and #6788
r? @jonas-schievink
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-02 17:42:45 +00:00
bors[bot]
3b347eaa4e
Merge #7134
...
7134: Fix infer error of macro invocation in array expr r=edwin0cheng a=edwin0cheng
Fixed following infer error:
```rust
macro_rules! bar { () => {0u32} }
fn test() {
let a = [bar!()]; // a : [unknown]
}
```
bors r+
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-02 14:16:26 +00:00
Edwin Cheng
63e330f402
Fix infer error of macro invocation in array expr
2021-01-02 22:06:59 +08:00
Edwin Cheng
fe5340d970
Introduce HygieneFrames for proper token hyginee
2021-01-02 20:39:57 +08:00
Lukas Wirth
18bf2e5af5
Add ConstParams to the ide layer
2021-01-01 14:43:16 +01:00
Lukas Wirth
0acdb73076
Add ConstParams to the HIR
2021-01-01 10:06:42 +01:00
Lukas Wirth
a142beaf01
Implement const block inference
2020-12-23 12:24:24 +01:00
Lukas Wirth
0a780c0ab3
Implement const pat inference
2020-12-23 12:15:38 +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
c1cb595382
Move to upstream macro_rules!
model
2020-12-15 15:37:37 +01:00
Edwin Cheng
9da1eee436
Add regression test
2020-12-15 15:24:35 +08:00
Florian Diebold
4788aaa5f0
Add test for #6852
2020-12-13 14:53:04 +01:00
Lukas Wirth
378ec2841b
Infer labeled blocks
2020-12-12 00:06:48 +01:00
Florian Diebold
78dd548243
Upgrade Chalk
...
Also make overflow depth and max type size configurable through env variables.
This can be helpful at least for debugging.
Fixes #6628 .
2020-12-07 11:48:58 +01:00
Florian Diebold
e5fd550dfd
Use correct, full substs for self type in impl
...
Without arbitrary self types, the self type could never refer to the method type
parameters, so this wasn't a problem; but with arbitrary self types, it can.
This fixes the crash from #6668 ; but it doesn't make method resolution work for
these methods.
2020-12-04 18:43:47 +01:00
Lukas Wirth
a5efefd3d7
Properly infer tuple struct patterns when encountering ellipsis
2020-11-24 16:11:40 +01:00