about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2014-12-26Accept `?Sized` as well as `Sized?`Nick Cameron-21/+74
Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.
2014-12-25Parse fully-qualified associated types in generics without whitespaceP1start-34/+10
This breaks code that looks like this: let x = foo as bar << 13; Change such code to look like this: let x = (foo as bar) << 13; Closes #17362. [breaking-change]
2014-12-24Add syntax for rangesNick Cameron-8/+32
2014-12-22rollup merge of #20141: frewsxcv/rfc438Alex Crichton-1/+1
RFC 248? I think you meant RFC 438. There ain’t an RFC 248, while 438 looks to be what is being referred to: https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-of-plus.md -------------- Chis Morgan has a pretty important documentation fix in #19385 and he hasn't responded in a while to that pull request so I rebased it for him Closes #19385
2014-12-22rollup merge of #20033: alexcrichton/deprecate-serialiseAlex Crichton-6/+6
This commit completes the deprecation story for the in-tree serialization library. The compiler will now emit a warning whenever it encounters `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now marked `#[unstable]` for when feature staging is enabled. All users of serialization can migrate to the `rustc-serialize` crate on crates.io which provides the exact same interface as the libserialize library in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable` and require `extern crate "rustc-serialize" as rustc_serialize` at the crate root in order to expand correctly. To migrate all crates, add the following to your `Cargo.toml`: [dependencies] rustc-serialize = "0.1.1" And then add the following to your crate root: extern crate "rustc-serialize" as rustc_serialize; Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable` and `RustcDecodable`. [breaking-change]
2014-12-22RFC 248? I think you meant RFC 438.Chris Morgan-1/+1
There ain’t an RFC 248, while 438 looks to be what is being referred to: https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-of-plus.md
2014-12-22serialize: Fully deprecate the libraryAlex Crichton-6/+6
This commit completes the deprecation story for the in-tree serialization library. The compiler will now emit a warning whenever it encounters `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now marked `#[unstable]` for when feature staging is enabled. All users of serialization can migrate to the `rustc-serialize` crate on crates.io which provides the exact same interface as the libserialize library in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable` and require `extern crate "rustc-serialize" as rustc_serialize` at the crate root in order to expand correctly. To migrate all crates, add the following to your `Cargo.toml`: [dependencies] rustc-serialize = "0.1.1" And then add the following to your crate root: extern crate "rustc-serialize" as rustc_serialize; Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable` and `RustcDecodable`. [breaking-change]
2014-12-21Fallout of std::str stabilizationAlex Crichton-132/+135
2014-12-21rollup merge of #20057: nick29581/array-syntaxAlex Crichton-1/+10
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported. Part of #19999 r? @nikomatsakis
2014-12-21rollup merge of #20039: barosl/if-let-friendly-errorAlex Crichton-2/+2
Fixes #19991.
2014-12-20Add support for multiple region bounds in where clausesJared Roesch-4/+3
2014-12-20Add parser support for generalized where clausesJared Roesch-49/+72
Implement support in the parser for generalized where clauses, as well as the conversion of ast::WherePredicates to ty::Predicate in `collect.rs`.
2014-12-20Fix fallout of removing import_shadowing in tests.Eduard Burtescu-4/+3
2014-12-20Allow use of `[_ ; n]` syntax for fixed length and repeating arrays.Nick Cameron-1/+10
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
2014-12-20Drop the Match prefix from the MatchSource variantsBarosl Lee-2/+2
2014-12-19libsyntax: use `#[deriving(Copy)]`Jorge Aparicio-23/+8
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-44/+109
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-16AST refactor: make the place in ExprBox an option.Felix S. Klock II-1/+4
This is to allow us to migrate away from UnUniq in a followup commit, and thus unify the code paths related to all forms of `box`.
2014-12-15Remove all shadowed lifetimes.Niko Matsakis-2/+2
2014-12-15auto merge of #19742 : vhbit/rust/copy-for-bitflags, r=alexcrichtonbors-1/+0
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-3/+19
results.
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-3/+21
integrating into rustdoc etc.
2014-12-14Rename FnStyle trait to Unsafety.Niko Matsakis-30/+20
2014-12-14Remove `proc` types/expressions from the parser, compiler, andNiko Matsakis-32/+29
language. Recommend `move||` instead.
2014-12-13libsyntax: use tuple indexingJorge Aparicio-10/+10
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-60/+80
2014-12-13Add `Copy` to bitflags-generated structuresValerii Hiora-1/+0
2014-12-12Add support for equality constraints on associated typesNick Cameron-42/+135
2014-12-11Register new snapshotsAlex Crichton-10/+4
2014-12-09auto merge of #19644 : pcwalton/rust/oibit3, r=nikomatsakisbors-0/+20
2014-12-08Revert "Register new snapshots"Alex Crichton-3/+3
This reverts commit 9b443289cf32cbcff16768614340f0c844675340.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+20
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-08auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichtonbors-23/+21
Now that we have an overloaded comparison (`==`) operator, and that `Vec`/`String` deref to `[T]`/`str` on method calls, many `as_slice()`/`as_mut_slice()`/`to_string()` calls have become redundant. This patch removes them. These were the most common patterns: - `assert_eq(test_output.as_slice(), "ground truth")` -> `assert_eq(test_output, "ground truth")` - `assert_eq(test_output, "ground truth".to_string())` -> `assert_eq(test_output, "ground truth")` - `vec.as_mut_slice().sort()` -> `vec.sort()` - `vec.as_slice().slice(from, to)` -> `vec.slice(from_to)` --- Note that e.g. `a_string.push_str(b_string.as_slice())` has been left untouched in this PR, since we first need to settle down whether we want to favor the `&*b_string` or the `b_string[]` notation. This is rebased on top of #19167 cc @alexcrichton @aturon
2014-12-06libsyntax: remove unnecessary `to_string()` callsJorge Aparicio-12/+12
2014-12-06libsyntax: remove unnecessary `as_slice()` callsJorge Aparicio-11/+9
2014-12-05Register new snapshotsAlex Crichton-3/+3
2014-12-05rollup merge of #19494: P1start/better-expectedCorey Richardson-68/+115
As an example of what this changes, the following code: ```rust let x: [int ..4]; ``` Currently spits out ‘expected `]`, found `..`’. However, a comma would also be valid there, as would a number of other tokens. This change adjusts the parser to produce more accurate errors, so that that example now produces ‘expected one of `(`, `+`, `,`, `::`, or `]`, found `..`’. (Thanks to cramer on IRC for pointing out this problem with diagnostics.)
2014-12-05rollup merge of #19480: cmr/es6-escapeCorey Richardson-8/+95
First half of bootstrapping https://github.com/rust-lang/rfcs/pull/446
2014-12-05rollup merge of #19413: P1start/more-trailing-commasCorey Richardson-7/+7
The only other place I know of that doesn’t allow trailing commas is closure types (#19414), and those are a bit tricky to fix (I suspect it might be impossible without infinite lookahead) so I didn’t implement that in this patch. There are other issues surrounding closure type parsing anyway, in particular #19410.
2014-12-04Make the parser’s ‘expected <foo>, found <bar>’ errors more accurateP1start-68/+115
As an example of what this changes, the following code: let x: [int ..4]; Currently spits out ‘expected `]`, found `..`’. However, a comma would also be valid there, as would a number of other tokens. This change adjusts the parser to produce more accurate errors, so that that example now produces ‘expected one of `(`, `+`, `,`, `::`, or `]`, found `..`’.
2014-12-03syntax: support ES6-style unicode escapesCorey Richardson-8/+95
First half of bootstrapping https://github.com/rust-lang/rfcs/pull/446
2014-12-03Deprecate EquivJorge Aparicio-0/+1
2014-12-03Replace `equiv` method calls with `==` operator sugarJorge Aparicio-1/+1
2014-12-03Overload the `==` operatorJorge Aparicio-0/+22
- String == &str == CowString - Vec == &[T] == &mut [T] == [T, ..N] == CowVec - InternedString == &str
2014-12-02auto merge of #19427 : scialex/rust/doc-attr-macros, r=sfacklerbors-0/+6
this allows one to, for example, use #[doc = $macro_var ] in macros.
2014-12-01auto merge of #19405 : jfager/rust/de-match-pyramid, r=bstriebors-44/+19
No semantic changes, no enabling `if let` where it wasn't already enabled.
2014-12-01auto merge of #19418 : P1start/rust/unsafe-extern-trait, r=alexcrichtonbors-7/+8
Fixes #19398.
2014-11-30auto merge of #19415 : P1start/rust/error-message-fixes, r=alexcrichtonbors-2/+2
This is the style followed by most other error messages.
2014-11-30allow macro expansions in attributesAlexander Light-0/+6
2014-11-30Allow trailing commas in array patterns and attributesP1start-7/+7