Commit Graph

1507 Commits

Author SHA1 Message Date
Nick Cameron ba43c228b5 Some cleanup of no longer used AST things 2015-10-09 11:53:42 +13: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](https://github.com/rust-lang/rust/blob/cd9c9f048f6aa0be091cd9835771ba0712bead4e/src/libsyntax/parse/parser.rs#L4691)
* [parse_tuple_struct_body](https://github.com/rust-lang/rust/blob/cd9c9f048f6aa0be091cd9835771ba0712bead4e/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 https://github.com/freebroccolo/rust/commit/8b07abaa6e8ab42d37656dfad89de0eb5810c3b3
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
Eduard Burtescu cc09b1a08c Turn on box(PLACE) expr deprecation warning post-snapshot. 2015-07-27 18:11:43 +03:00
mitaa adfdbc4bd7 Remove ast::LocalSource with only one used variant
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-26 08:56:29 +02:00
bors 9413a926fc Auto merge of #27215 - pnkfelix:fsk-placer-take-5-just-in, r=nikomatsakis
Macro desugaring of `in PLACE { BLOCK }` into "simpler" expressions following the in-development "Placer" protocol.

Includes Placer API that one can override to integrate support for `in` into one's own type.  (See [RFC 809].)

[RFC 809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md

Part of #22181

Replaced PR #26180.

Turns on the `in PLACE { BLOCK }` syntax, while leaving in support for the old `box (PLACE) EXPR` syntax (since we need to support that at least until we have a snapshot with support for `in PLACE { BLOCK }`.

(Note that we are not 100% committed to the `in PLACE { BLOCK }` syntax.  In particular I still want to play around with some other alternatives.  Still, I want to get the fundamental framework for the protocol landed so we can play with implementing it for non `Box` types.)

----

Also, this PR leaves out support for desugaring-based `box EXPR`.  We will hopefully land that in the future, but for the short term there are type-inference issues injected by that change that we want to resolve separately.
2015-07-24 10:12:20 +00:00
bors 2e5b165e18 Auto merge of #27203 - marcusklaas:fix-range-span, r=alexcrichton
Right trims the span for certain range expressions.

Closes https://github.com/rust-lang/rust/issues/27162.
2015-07-23 12:52:21 +00:00
Felix S. Klock II abad7d6bba placate make tidy. 2015-07-22 23:23:36 +02:00
Felix S. Klock II 9f6f35bef4 Added support for parsing in PLACE { BLOCK_CONTENT }. 2015-07-22 15:34:01 +02:00
Marcus Klaas b36d107b83 Assign proper span to range expression 2015-07-21 23:04:23 +02:00
Nick Cameron f47d20aecd Use a span from the correct file for the inner span of a module
This basically only affects modules which are empty (or only contain comments).

Closes #26755
2015-07-21 21:55:19 +12:00
Marcus Klaas 12963606d0 Include label in the span of loops 2015-07-18 11:53:55 +02:00
bors 7ea2674c75 Auto merge of #26750 - nrc:refactor-submod, r=sfackler
This makes the functionality usable from outside the parser
2015-07-13 01:07:51 +00:00
Wesley Wiser 93ddee6cee Change some instances of .connect() to .join() 2015-07-10 19:40:46 -04:00