Commit graph

3436 commits

Author SHA1 Message Date
bors[bot]
3575f7c4a2
Merge #1884
1884: Add indexing to record_field_pat r=matklad a=kjeremy

Fixes #1870 

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-09-20 15:54:01 +00:00
kjeremy
17a45a686c Apply suggestion 2019-09-20 11:49:45 -04:00
bors[bot]
0492b18ed4
Merge #1883
1883: Fix path attribute causing false "unresolved module" error for submodules r=matklad a=gfreezy

fixed #1880

Co-authored-by: gfreezy <gfreezy@gmail.com>
2019-09-20 15:45:58 +00:00
kjeremy
5a65d4d9fb Add indexing to record_field_pat 2019-09-20 11:43:34 -04:00
gfreezy
6a4cf48bff fix module attr path 2019-09-20 23:20:43 +08:00
Aleksey Kladov
d57b993ade fix infinite loop in the parser
closes #1866
2019-09-20 16:57:31 +03:00
bors[bot]
c733993658
Merge #1881
1881: don't confuse macro with != r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-09-20 13:24:07 +00:00
Aleksey Kladov
0f70290b6e don't confuse macro with !=
closes #1871
2019-09-20 16:23:24 +03:00
bors[bot]
b19da133ee
Merge #1850
1850: feat(assists): raw string <-> usual string manipulation r=matklad a=Geobert

Fixes #1730

Co-authored-by: Geobert Quach <geobert@protonmail.com>
2019-09-20 10:40:15 +00:00
Geobert Quach
ce4d843656 feat(assists): Apply comments 2019-09-19 22:12:28 +01:00
Geobert Quach
a3ab80b332 feat(assists): Rename escape_quote to escape_double_quote 2019-09-19 22:12:28 +01:00
Geobert Quach
889f1f0a7c feature(assists): Fix regression 2019-09-19 22:12:28 +01:00
Geobert Quach
016c997243 feat(assists): manage " when removing hash and make_usual_string 2019-09-19 22:12:28 +01:00
Geobert Quach
b6d55290a1 feat(assists): raw string <-> usual string manipulation
Fixes #1730
2019-09-19 22:12:28 +01:00
kjeremy
e26c41d611 A few doc comments 2019-09-19 17:07:23 -04:00
kjeremy
883edd002e Replace usages of bump_any with bump 2019-09-19 15:51:46 -04:00
bors[bot]
cd9b222ba0
Merge #1853
1853: Introduce FromSource trait r=matklad a=viorina

The idea is to provide an ability to get HIR from AST in a more general way than it's possible using `source_binder`. 
It also could help with #1622 fixing.

Co-authored-by: Ekaterina Babshukova <ekaterina.babshukova@yandex.ru>
2019-09-19 18:18:41 +00:00
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
Aleksey Kladov
b31b7ab238 slightly cleanup macro tests 2019-09-19 13:44:51 +03:00
Aleksey Kladov
1e16ac0315 tweak installation process 2019-09-18 14:24:20 +03: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
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
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
Aleksey Kladov
4551182f94 use usual token tree for macro expansion 2019-09-17 15:51:48 +03: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
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
Dylan MacKenzie
0956323bb7 Generate dot_dot_test 2019-09-14 17:08:22 -07:00