Commit Graph

5026 Commits

Author SHA1 Message Date
Ekaterina Babshukova
2867c40925 introduce FromSource trait 2019-09-19 19:38:27 +03:00
bors[bot]
44bab3621d
Merge #1873
1873: `fold_kind`: `MATCH_ARM_LIST => FoldKind::Block` r=matklad a=Centril

As suggested by @matklad in https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/folding.20of.20.60match.60.20and.20.60if.60/near/176109093.

This should let folks fold all the arms in a `match` expression rather than just each arm individually.

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2019-09-19 15:56:38 +00:00
Mazdak Farrokhzad
2be9031935
Pacify rustfmt. 2019-09-19 17:37:41 +02:00
bors[bot]
4eb0bb4810
Merge #1874
1874: move fold conversino to conv.rs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-19 15:31:42 +00:00
Aleksey Kladov
36732a42bd move fold conversino to conv.rs 2019-09-19 18:27:47 +03:00
Mazdak Farrokhzad
1f97445f39
fold_kind: MATCH_ARM_LIST => FoldKind::Block 2019-09-19 17:22:08 +02:00
Aleksey Kladov
184e80007b fix typo 2019-09-19 18:18:58 +03:00
bors[bot]
eeac224c35
Merge #1872
1872: slightly cleanup macro tests r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-19 10:45:22 +00:00
Aleksey Kladov
b31b7ab238 slightly cleanup macro tests 2019-09-19 13:44:51 +03:00
bors[bot]
c35ef7e1ed
Merge #1868
1868: Fixed markdown in user README r=kjeremy a=zoewithabang

Link pointing to the GitHub issue regarding why a full restart of VS Code is needed was broken.

Co-authored-by: zoewithabang <zoewithabang@gmail.com>
2019-09-18 17:33:31 +00:00
zoewithabang
8c2f81fdd0 Fixed markdown in user README 2019-09-18 15:01:56 +01:00
bors[bot]
9dd1dcf5ac
Merge #1867
1867: tweak installation process r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-18 11:24:53 +00:00
Aleksey Kladov
1e16ac0315 tweak installation process 2019-09-18 14:24:20 +03:00
bors[bot]
630d212525
Merge #1861
1861: account for impls generated by macros r=matklad a=matklad

The code is pretty horrible and is copy-pased from expressions. We really need to find a better way to lower stuff generated by macros. But it gets the job done! I've actually though that we did this ages ago, but obviously we didn't

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-18 01:36:40 +00:00
Aleksey Kladov
7d15c81a33 account for impls generated by macros 2019-09-18 04:34:48 +03:00
bors[bot]
54379ec6f8
Merge #1862
1862: Assoc item resolution refactoring (again) r=flodiebold a=flodiebold

This is #1849, with the associated type selection code removed for now. Handling cycles there will need some more thought.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-09-17 21:16:28 +00:00
Florian Diebold
c2f9558e1a Remove assoc type selection code for now to fix crashes 2019-09-17 23:11:20 +02:00
Florian Diebold
69c8cfc4c1 Add test for T::Item cycles 2019-09-17 23:06:05 +02:00
bors[bot]
d505ee968b
Merge #1860
1860: remove confusing code r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-17 18:06:06 +00:00
Aleksey Kladov
2890a1450a remove confusing code
I must confess I don't really understand what this code is trying to
do, but it definitely misreports changes during fixedpoint iteration,
and no tests fail if I remove it, so...
2019-09-17 21:04:15 +03:00
bors[bot]
1f41eb28e2
Merge #1859
1859: show error log by default r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-17 17:54:44 +00:00
Aleksey Kladov
9ad2cea251 show error log by default 2019-09-17 20:53:12 +03:00
Florian Diebold
a040fde3ae Remove TraitItem and ImplItem in favor of AssocItem 2019-09-17 19:47:45 +02:00
Florian Diebold
53a932509d Small review improvements 2019-09-17 19:47:45 +02:00
Florian Diebold
35d1c03896 Add test for <T>::Item 2019-09-17 19:47:45 +02:00
Florian Diebold
fe1dfd2b20 Refactor some more
Type-relative paths (`<T>::foo`) also need to work in type context, for example
`<T>::Item` is legal. So rather than returning the type ref from the resolver
function, just check it before.
2019-09-17 19:47:45 +02:00
Florian Diebold
406280e52f Refactor associated item resolution more
When resolving an associated item in value namespace, use the `Ty` lowering code
for the segments before the last instead of replicating it.
2019-09-17 19:47:45 +02:00
Florian Diebold
828d60574f Refactor a bit to prepare for resolving trait assoc items 2019-09-17 19:47:45 +02:00
Florian Diebold
913ab1ec0a Resolve assoc types on type parameters
E.g. `fn foo<T: Iterator>() -> T::Item`. It seems that rustc does this only for
type parameters and only based on their bounds, so we also only consider traits
from bounds.
2019-09-17 19:47:45 +02:00
Florian Diebold
16ee779483 Adapt some tests 2019-09-17 19:47:45 +02:00
bors[bot]
9421d2a953
Merge #1858
1858: use usual token tree for macro expansions r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-17 12:53:01 +00:00
Aleksey Kladov
4551182f94 use usual token tree for macro expansion 2019-09-17 15:51:48 +03:00
bors[bot]
8eb2697b7d
Merge #1855
1855: split mbe expander code into two modules r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-16 23:06:38 +00:00
Aleksey Kladov
37ef8927c3 split mbe expander code into two modules 2019-09-17 02:06:14 +03:00
bors[bot]
ba583091e6
Merge #1817
1817: Support path starting with a type r=matklad a=uHOOCCOOHu

The path syntax `<Ty>::foo`

Co-authored-by: uHOOCCOOHu <hooccooh1896@gmail.com>
2019-09-16 12:43:21 +00:00
bors[bot]
6b33b90091
Merge #1852
1852: Gracefully handle `const _` items in `ConstData` r=ecstatic-morse a=ecstatic-morse

A follow-up to #1847.

This makes the `name` field of `ConstData` optional.

Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
2019-09-16 06:09:30 +00:00
Dylan MacKenzie
cd8155b7f7 Remove is_unnamed 2019-09-15 23:08:32 -07:00
Dylan MacKenzie
beac779c96 Gracefully handle const _ items in ConstData 2019-09-15 16:48:50 -07:00
uHOOCCOOHu
7ed3be3291
Define known paths and group names 2019-09-15 20:14:33 +08:00
uHOOCCOOHu
de9670fe45
Move store TypeRef of type based path in PathKind 2019-09-15 19:48:24 +08:00
uHOOCCOOHu
4926bed426
Support path starting with a type 2019-09-15 19:40:32 +08:00
bors[bot]
2d79a1ad83
Merge #1848
1848: Parse `..` as a full pattern r=matklad a=ecstatic-morse

Resolves #1479.

This PR implements [RFC 2707](https://github.com/rust-lang/rfcs/pull/2707) in the parser. It introduces a new `DotDotPat` AST node modeled on `PlaceholderPat` and changes the parsing of tuple and slice patterns to conform to the RFC.

Notably, this PR does *not* change the resulting AST when `..` appears in a struct pattern (e.g. `Struct { a, b: c, .. }`). I *think* this is the behavior mandated by RFC 2707, but someone should confirm this.

Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
2019-09-15 07:10:16 +00:00
bors[bot]
bcdba777bd
Merge #1847
1847: Allow an underscore as the identifier in `const` items r=matklad a=ecstatic-morse

[RFC 2526](https://github.com/rust-lang/rust/issues/54912) was recently stabilized, meaning `const _: i32 = 5;` is now a valid item.

Co-authored-by: Dylan MacKenzie <ecstaticmorse@gmail.com>
2019-09-15 07:02:51 +00:00
Dylan MacKenzie
0956323bb7 Generate dot_dot_test 2019-09-14 17:08:22 -07:00
Dylan MacKenzie
da3815122d Bless old tests containing a .. pattern 2019-09-14 17:08:22 -07:00
Dylan MacKenzie
4a3a15f0e7 Parse .. as a proper pattern 2019-09-14 17:08:22 -07:00
Dylan MacKenzie
426112c97e Add DotDotPat to AST
This is modeled on `PlaceholderPat`.
2019-09-14 17:08:22 -07:00
Dylan MacKenzie
c413f444a0 Add tests for underscores in const and static items 2019-09-14 16:31:09 -07:00
Dylan MacKenzie
253a18f938 Allow an underscore as the identifier in const items 2019-09-14 16:31:09 -07:00
bors[bot]
211171ffe6
Merge #1846
1846: Remove a dbg! r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-09-14 09:06:23 +00:00