about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2014-02-13Remove obsolete warnings for `extern mod`Flavio Percoco-12/+0
This patch gets rid of ObsoleteExternModAttributesInParens and ObsoleteNamedExternModule since the replacement of `extern mod` with `extern crate` avoids those cases and raises different errors. Both have been around for at least a version which makes this a good moment to get rid of them.
2014-02-13Replace `extern mod` with `extern crate`Flavio Percoco-105/+108
This patch adds a new keyword `crate` which is intended to replace mod in the context of `extern mod` as part of the issue #9880. The patch doesn't replace all `extern mod` cases since it is necessary to first push a new snapshot 0. The implementation could've been less invasive than this. However I preferred to take this chance to split the `parse_item_foreign_mod` method and pull the `extern crate` part out of there, hence the new method `parse_item_foreign_crate`.
2014-02-11Correct span for self and ExprStructSeo Sanghyeon-2/+2
2014-02-11auto merge of #12170 : aepsil0n/rust/feature/reserve_do_keyword, r=brsonbors-0/+1
This resolves issue #12157. Does that do it already or is there something else that needs taking care of? As a side note, there seems to be some documentation, in which the old existence of the do keyword is explained. The list of keywords is not up-to-date either. But these are certainly separate issues.
2014-02-11Reserve `do` as a keywordEduard Bopp-0/+1
Resolves issue #12157. `do` is hereby reinstated as a keyword; no syntax is associated with it though. Along the way, a unit test had to be adapted, since it was using `do` as a method identifier. Breaking changes: - Any code using `do` as an identifier will no longer work.
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-7/+7
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-08Fixed error starting with uppercasemr.Shu-5/+5
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-08auto merge of #12098 : kballard/rust/from_utf8_lossy_tweak, r=huonwbors-2/+2
MaybeOwned allows from_utf8_lossy to avoid allocation if there are no invalid bytes in the input. Before: ``` test str::bench::from_utf8_lossy_100_ascii ... bench: 183 ns/iter (+/- 5) test str::bench::from_utf8_lossy_100_invalid ... bench: 341 ns/iter (+/- 15) test str::bench::from_utf8_lossy_100_multibyte ... bench: 227 ns/iter (+/- 13) test str::bench::from_utf8_lossy_invalid ... bench: 102 ns/iter (+/- 4) test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0) test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0) ``` Now: ``` test str::bench::from_utf8_lossy_100_ascii ... bench: 96 ns/iter (+/- 4) test str::bench::from_utf8_lossy_100_invalid ... bench: 318 ns/iter (+/- 10) test str::bench::from_utf8_lossy_100_multibyte ... bench: 105 ns/iter (+/- 2) test str::bench::from_utf8_lossy_invalid ... bench: 105 ns/iter (+/- 2) test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0) test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0) ```
2014-02-08auto merge of #12086 : huonw/rust/safe-json, r=kballardbors-116/+157
The lexer and json were using `transmute(-1): char` as a sentinel value for EOF, which is invalid since `char` is strictly a unicode codepoint. Fixing this allows for range asserts on chars since they always lie between 0 and 0x10FFFF.
2014-02-07Rewrite path::Display to reduce unnecessary allocationKevin Ballard-2/+2
2014-02-08std::fmt: convert the formatting traits to a proper self.Huon Wilson-2/+2
Poly and String have polymorphic `impl`s and so require different method names.
2014-02-08syntax: convert the lexer to use Option<char> over transmute(-1).Huon Wilson-116/+157
The transmute was unsound. There are many instances of .unwrap_or('\x00') for "ignoring" EOF which either do not make the situation worse than it was (well, actually make it better, since it's easy to grep for places that don't handle EOF) or can never ever be read. Fixes #8971.
2014-02-07Correct span for ExprFnBlock, ExprMethodCall, ExprParenSeo Sanghyeon-3/+3
2014-02-07Removed @self and @Trait.Eduard Burtescu-94/+83
2014-02-06auto merge of #12048 : sanxiyn/rust/crate-config, r=alexcrichtonbors-3/+3
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-2/+2
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-06Avoid cloning ast::CrateConfigSeo Sanghyeon-3/+3
2014-02-04Replace NonCopyable usage with NoPodFlavio Percoco-2/+3
cc #10834
2014-02-03Fixing remaining warnings and errors throughoutAlex Crichton-2/+2
2014-02-03syntax: Remove io_error usageAlex Crichton-4/+4
2014-02-02std: rename fmt::Default to `Show`.Huon Wilson-1/+1
This is a better name with which to have a #[deriving] mode. Decision in: https://github.com/mozilla/rust/wiki/Meeting-weekly-2014-01-28
2014-02-02rustc: update docs & propagate @[]/@str removal more.Huon Wilson-1/+1
Various functions can now be made specific to ~[], or just non-managed vectors.
2014-02-02rustc: Remove the vstore handling of @str and @[].Huon Wilson-1/+1
2014-02-02syntax: remove the handling of @str and @[] from the parser completely.Huon Wilson-30/+9
2014-02-02syntax: add an obsolete syntax warning for @[].Huon Wilson-1/+9
2014-02-02Changes from the review of the @str PR.Huon Wilson-7/+0
2014-02-02Fix `@str` removal tests.Huon Wilson-1/+0
2014-02-02librustc: Remove `@str` from the languagePatrick Walton-5/+14
2014-02-02libsyntax: Remove `@str` from the internerPatrick Walton-11/+14
2014-02-02libsyntax: Remove the `interner_get` function and all usesPatrick Walton-28/+2
2014-02-02libsyntax: Remove uses of `token::ident_to_str()`Patrick Walton-29/+14
2014-02-02libsyntax: Remove many uses of `token::ident_to_str`Patrick Walton-4/+4
2014-02-02libsyntax: Fix tests.Patrick Walton-25/+25
2014-02-02libsyntax: Remove `ident_to_str` from the parser, which was returningPatrick Walton-10/+8
`@str` values
2014-02-02libsyntax: Remove all `@str` from the ASTPatrick Walton-5/+8
2014-02-02libsyntax: Make float literals not use `@str`Patrick Walton-3/+6
2014-02-02libsyntax: De-`@str` pathnamesPatrick Walton-17/+13
2014-02-02librustc: Stop using `@str` for source.Patrick Walton-48/+42
2014-02-02libsyntax: Remove the unnecessary `src` field from the lexerPatrick Walton-9/+6
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-9/+24
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-5/+96
compiler and use it for attributes
2014-01-31Remove the obsolete handler for `impl A;`.Huon Wilson-19/+8
This is has been obsolete for quite a while now (including a release), so removing the special handling seems fine. (The error message is quite good still anyway.) Fixes #9580.
2014-01-30Implement default type parameters in generics.Eduard Burtescu-5/+25
2014-01-30auto merge of #11911 : kballard/rust/empty-functional-update, r=pcwaltonbors-11/+6
Fixes #8972
2014-01-29Allow empty functional updating of structsKevin Ballard-11/+6
Fixes #8972
2014-01-29Removing support for the do syntax from libsyntax and librustc.Scott Lawrence-116/+41
Fixes #10815.
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-39/+35
Fixes #10667 and closes #10259.
2014-01-26auto merge of #11817 : salemtalha/rust/master, r=brsonbors-4/+4
Fixes Issue #11815
2014-01-26Removed all instances of XXX in preparation for relaxing of FIXME ruleSalem Talha-4/+4
2014-01-26Fix privacy fallout from previous changeAlex Crichton-1/+1