Aleksey Kladov
bf2f1e512a
parser: fix erroneous comment
...
Qualified paths allow full path after the `>::`. For example
```rust
<T as Foo>::U::generic_method::<f64>()
```
The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2015-10-23 02:17:03 +03:00
Marcus Klaas
e5962c206e
Fix span for pattern literals
2015-10-18 14:45:56 +02:00
bors
a668dd2a56
Auto merge of #28827 - thepowersgang:unsafe-const-fn-2, r=Aatch
...
This is the original test implementation, which works according to the tests I wrote, but might need a review.
2015-10-14 10:17:30 +00:00
Vadim Petrochenkov
46750d0409
Merge VariantData and VariantData_
2015-10-13 15:19:27 +03:00
Vadim Petrochenkov
40aa09e4c9
Merge struct fields and struct kind
2015-10-13 15:19:25 +03:00
Vadim Petrochenkov
30af54dede
Dict -> Struct, StructDef -> VariantData, def -> data
2015-10-13 15:19:24 +03:00
Vadim Petrochenkov
8a12c19171
Test and gate empty structures and variants better
2015-10-13 15:19:20 +03:00
Vadim Petrochenkov
877c35e8a2
Remove now redundant NodeId from Variant
2015-10-13 15:19:18 +03:00
Vadim Petrochenkov
495566ee61
Decouple structure kinds from NodeIds
2015-10-13 15:19:17 +03:00
Vadim Petrochenkov
ea47c2b6b3
Unify structures and enum variants in AST
2015-10-13 15:19:15 +03:00
Nick Cameron
ba43c228b5
Some cleanup of no longer used AST things
2015-10-09 11:53:42 +13:00
John Hodge
4c88bf2885
Implement original version of RFC#1245
2015-10-03 23:42:22 +08:00
bors
2e88c36ebc
Auto merge of #28642 - petrochenkov:name3, r=nrc
...
This PR removes random remaining `Ident`s outside of libsyntax and performs general cleanup
In particular, interfaces of `Name` and `Ident` are tidied up, `Name`s and `Ident`s being small `Copy` aggregates are always passed to functions by value, and `Ident`s are never used as keys in maps, because `Ident` comparisons are tricky.
Although this PR closes https://github.com/rust-lang/rust/issues/6993 there's still work related to it:
- `Name` can be made `NonZero` to compress numerous `Option<Name>`s and `Option<Ident>`s but it requires const unsafe functions.
- Implementation of `PartialEq` on `Ident` should be eliminated and replaced with explicit hygienic, non-hygienic or member-wise comparisons.
- Finally, large parts of AST can potentially be converted to `Name`s in the same way as HIR to clearly separate identifiers used in hygienic and non-hygienic contexts.
r? @nrc
2015-09-26 14:48:56 +00:00
Vadim Petrochenkov
f284cbc7af
Cleanup interfaces of Name, SyntaxContext and Ident
...
Make sure Name, SyntaxContext and Ident are passed by value
Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-24 23:05:02 +03:00
Eduard Burtescu
f293ea28b4
Remove the deprecated box(PLACE) syntax.
2015-09-24 18:00:08 +03:00
bors
d2faba28c0
Auto merge of #28552 - apasel422:issue-28527, r=Manishearth
...
Closes #28527 .
r? @Manishearth
2015-09-21 02:40:40 +00:00
bors
79d259e618
Auto merge of #28534 - marcusklaas:fix-mod-inner-span, r=alexcrichton
...
Fixes https://github.com/rust-lang/rust/issues/28520 .
r? @alexcrichton or @nrc?
2015-09-20 21:31:24 +00:00
Andrew Paseltiner
85b8b447fa
Replace ast::Mac_ enum with struct
...
Closes #28527 .
2015-09-20 17:15:04 -04:00
Marcus Klaas
51f4a241bf
Fix the overly long inner spans of inline mods
2015-09-20 14:06:58 +02:00
bors
fd38a75077
Auto merge of #28503 - marcusklaas:pub-extern, r=alexcrichton
...
Fixes https://github.com/rust-lang/rust/issues/28472 .
2015-09-20 05:44:45 +00:00
bors
d97be7bd70
Auto merge of #28486 - nrc:pub-extern-crate, r=alexcrichton
...
Temporary 'fix' for #26775
r? @brson
2015-09-19 04:51:13 +00:00
Marcus Klaas
e2f3e3ac4f
Include visibility modifier in span of foreign item
2015-09-19 00:34:04 +02:00
bors
72a10fa1d3
Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichton
...
Followup on #28440
Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
2015-09-18 18:51:04 +00:00
Vadim Petrochenkov
5fa6e857c9
Implement empty struct with braces (RFC 218)
2015-09-18 15:26:08 +03:00
Nick Cameron
269c59d341
Warn on pub extern crate.
...
Temporary 'fix' for #26775
2015-09-18 18:07:05 +12:00
Simonas Kazlauskas
f5a99ae7fb
Remove Visibility field from enum variants
...
Followup on #28440
2015-09-17 10:02:59 +03:00
Aleksey Kladov
e3be84c6c8
libsyntax: forbid visibility modifiers for enum variants
...
fixes #28433
2015-09-17 10:02:08 +03:00
Nick Cameron
4fbe514985
Fix the span for ! returns
2015-09-17 15:13:51 +12:00
bors
bc6c3970a0
Auto merge of #28247 - christopherdumas:fix_28243, r=eddyb
...
as per #28243 .
2015-09-14 20:37:49 +00:00
christopherdumas
afa905fcf5
Fix tuple float bug.
2015-09-14 07:26:11 -07:00
bors
9040b06ed2
Auto merge of #28286 - matklad:remove-dead-code, r=eddyb
...
There is a dead code in libsyntax/parser/parse.rs, when parsing structs.
Two functions are involved:
* [parse_item_struct](cd9c9f048f/src/libsyntax/parse/parser.rs (L4691) )
* [parse_tuple_struct_body](cd9c9f048f/src/libsyntax/parse/parser.rs (L4769) )
The problem is that both functions handle the case with unit structs. But because
`parse_tuple_struct_body` is called from `parse_item_struct`, it never faces
this case.
This PR removes unit struct case from `parse_tuple_struct_body` function. I tested with `make -j8 check-statge1`.
2015-09-13 13:09:22 +00:00
Vadim Petrochenkov
9f1f4c16aa
Remove some remains of virtual structs from the parser
2015-09-11 10:09:22 +03:00
Aleksey Kladov
c87a58fe4b
libsyntax: minor clean up
...
Escape `{` in format strings as `{{`, instead of using a substitution
2015-09-10 15:14:24 +03:00
Nick Cameron
5fbdf3ccd0
Fix span bug with >> and type bindings
2015-09-08 16:28:12 +12:00
Aleksey Kladov
0e96c28236
libsyntax: restore lost error message
2015-09-07 22:15:36 +03:00
Aleksey Kladov
c8da5697e0
libsyntax: remove dead code from parser.rs
...
Both `parse_tuple_struct_body` and `parse_item_struct` handled the case
of unit like struct. The redundancy is removed,
`parse_tuple_struct_body` now handles only real tuple structs.
2015-09-07 20:08:57 +03:00
christopherdumas
cd9c9f048f
functional structure update syntax -> structure update syntax
2015-09-06 09:13:20 -07:00
bors
791e7bcb41
Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichton
...
r? @alexcrichton
2015-09-04 05:15:22 +00:00
Vadim Petrochenkov
405c616eaf
Use consistent terminology for byte string literals
...
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03 10:54:53 +03:00
Simonas Kazlauskas
d8074e65b0
Use proper span for break and continue labels
...
Fixes #28109
2015-09-03 03:50:43 +03:00
Marcus Klaas
3a360fca78
Fix overly long spans for break and continue
...
The spans of break and continue would include the next token.
2015-09-02 20:55:17 +02:00
Marcus Klaas
b69347c00c
Assign correct span to continue expression
...
Fixes https://github.com/rust-lang/rust/issues/28105 .
2015-08-30 20:44:36 +02:00
Georg Brandl
29945d5db0
syntax: fix use of "vector" for [x; n] literal and [x, y] patterns
2015-08-11 17:41:06 +02:00
bors
8856927f64
Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton
...
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219 ).
The RFC is not merged yet, but once merged, this could be.
2015-08-10 20:24:06 +00:00
Sean McArthur
cfcd449c4c
rustc: rename multiple imports in a list
2015-08-08 11:54:15 -07:00
Jared Roesch
edca562c87
Make parser recognize macro invocations in types
...
Reapplied the changes from 8b07abaa6e
to a clean branch of master
2015-08-04 16:05:06 -07:00
Seo Sanghyeon
b5139c5c58
Fix impl A .. {}
2015-07-31 21:24:55 +09:00
Simonas Kazlauskas
cca0ea718d
Replace illegal with invalid in most diagnostics
2015-07-29 01:59:31 +03:00
bors
55ede7ed8e
Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddyb
...
this has quite some fallout. but also made lots of stuff more readable imo
[breaking-change] for plugin authors
2015-07-28 21:14:28 +00:00
Oliver Schneider
00a5e66f81
remove get_ident and get_name, make as_str sound
2015-07-28 18:07:20 +02:00