summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-11-15Improve examples for syntax::ext::deriving::encodableBarosl Lee-31/+40
The examples in the documentation for syntax::ext::deriving::encodable are outdated, and do not work. To fix this, the following changes are applied: - emit_field() -> emit_struct_field() - read_field() -> read_struct_field() - Use Result to report errors - Add the mut keyword to Encoder/Decoder - Prefer Encodable::encode() to emit_uint
2014-11-14auto merge of #18840 : huonw/rust/tweaks, r=alexcrichtonbors-24/+47
Fix some old papercuts with diagnostics, e.g. tweaking spans, rewording messages. See individual commits.
2014-11-14auto merge of #18827 : bjz/rust/rfc369-numerics, r=alexcrichtonbors-4/+6
This implements a considerable portion of rust-lang/rfcs#369 (tracked in #18640). Some interpretations had to be made in order to get this to work. The breaking changes are listed below: [breaking-change] - `core::num::{Num, Unsigned, Primitive}` have been deprecated and their re-exports removed from the `{std, core}::prelude`. - `core::num::{Zero, One, Bounded}` have been deprecated. Use the static methods on `core::num::{Float, Int}` instead. There is no equivalent to `Zero::is_zero`. Use `(==)` with `{Float, Int}::zero` instead. - `Signed::abs_sub` has been moved to `std::num::FloatMath`, and is no longer implemented for signed integers. - `core::num::Signed` has been removed, and its methods have been moved to `core::num::Float` and a new trait, `core::num::SignedInt`. The methods now take the `self` parameter by value. - `core::num::{Saturating, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv}` have been removed, and their methods moved to `core::num::Int`. Their parameters are now taken by value. This means that - `std::time::Duration` no longer implements `core::num::{Zero, CheckedAdd, CheckedSub}` instead defining the required methods non-polymorphically. - `core::num::{zero, one, abs, signum}` have been deprecated. Use their respective methods instead. - The `core::num::{next_power_of_two, is_power_of_two, checked_next_power_of_two}` functions have been deprecated in favor of methods defined a new trait, `core::num::UnsignedInt` - `core::iter::{AdditiveIterator, MultiplicativeIterator}` are now only implemented for the built-in numeric types. - `core::iter::{range, range_inclusive, range_step, range_step_inclusive}` now require `core::num::Int` to be implemented for the type they a re parametrized over.
2014-11-13auto merge of #18811 : pczarn/rust/issue-18763-ice, r=pnkfelixbors-30/+22
Fix ICEs introduced in #17830 * fixed get_tt for doc comments * properly handle MatchNt in `quote` Fixes #18763 Fixes #18775
2014-11-13fix "warning: deprecated syntax, use `for` keyword now"Jorge Aparicio-2/+2
2014-11-13auto merge of #18879 : pcwalton/rust/path-silliness, r=aturonbors-1/+8
This breaks code like: struct Foo { x: int, } let f: Foo = ...; ... f.x::<int> ... Change this code to not contain an unused type parameter. For example: struct Foo { x: int, } let f: Foo = ...; ... f.x ... Closes #18680. [breaking-change] r? @aturon
2014-11-13Use the correct span for out-of-range int literals.Huon Wilson-1/+2
This corrects the error message to point at the literal, not the next token. Closes #17123.
2014-11-13Add more "help: ..."'s to the parser.Huon Wilson-23/+38
Adds a method for printing a fatal error and also a help message to the parser and uses this in a variety of places to improve error messages. Closes #12213.
2014-11-13Add error message specific to \<carriage return>.Huon Wilson-0/+7
This can crop-up with a misconfigured editor or an unexpected interaction between version control and certain operating systems. Closes #11669.
2014-11-12Register new snapshotsAlex Crichton-6/+0
2014-11-13Remove lots of numeric traits from the preludesBrendan Zabarauskas-0/+3
Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
2014-11-13Deprecate Zero and One traitsBrendan Zabarauskas-3/+2
2014-11-13Move checked arithmetic operators into Int traitBrendan Zabarauskas-1/+1
2014-11-12auto merge of #18841 : Manishearth/rust/doc-ty, r=alexcrichtonbors-2/+18
I'll probably start documenting the rest of `syntax::ast` whenever I get time.
2014-11-11librustc: Allow linkage attribute on any statics, not just foreign statics.Luqman Aden-0/+4
2014-11-11libsyntax: Forbid type parameters in field expressions.Patrick Walton-1/+8
This breaks code like: struct Foo { x: int, } let f: Foo = ...; ... f.x::<int> ... Change this code to not contain an unused type parameter. For example: struct Foo { x: int, } let f: Foo = ...; ... f.x ... Closes #18680. [breaking-change]
2014-11-11syntax: improve message for misused inner attributesLiigo Zhuang-0/+2
2014-11-10Document ast::Ty_Manish Goregaokar-2/+18
2014-11-09Fix ICEs that involved quasi-quotationPiotr Czarnecki-30/+22
* fixed get_tt for doc comments * properly handle MatchNt in `quote` Fixes #18763 Fixes #18775
2014-11-09auto merge of #18755 : japaric/rust/ord, r=alexcrichtonbors-10/+31
Closes #18738 cc #15689 r? @alexcrichton cc @cmr
2014-11-09auto merge of #18743 : nikomatsakis/rust/hrtb-refactor-2, r=pcwaltonbors-219/+294
Various miscellaneous changes pushing towards HRTB support: 1. Update parser and adjust ast to support `for<'a,'b>` syntax, both in closures and trait bounds. Warn on the old syntax (not error, for stage0). 2. Refactor TyTrait representation to include a TraitRef. 3. Purge `once_fns` feature gate and `once` keyword. r? @pcwalton This is a [breaking-change]: - The `once_fns` feature is now officially deprecated. Rewrite using normal closures or unboxed closures. - The new `for`-based syntax now issues warnings (but not yet errors): - `fn<'a>(T) -> U` becomes `for<'a> fn(T) -> U` - `<'a> |T| -> U` becomes `for<'a> |T| -> U`
2014-11-08auto merge of #18475 : gamazeps/rust/toExtend, r=alexcrichtonbors-1/+1
Ensured that Extend & FromIterator are implemented for the libcollection. Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache). Changed the name from Extend to Extendable. Part of #18424
2014-11-08Renamed Extendable to Extendgamazeps-1/+1
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-08auto merge of #18634 : alexcrichton/rust/cfg-attr-crate-level, r=sfacklerbors-13/+56
This commit implements processing these two attributes at the crate level as well as at the item level. When #[cfg] is applied at the crate level, then the entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute is processed as usual in that the attribute is included or not depending on whether the cfg matches. This was spurred on by motivations of #18585 where #[cfg_attr] annotations will be applied at the crate-level. cc #18585
2014-11-07Update Partial/Total Eq/Ord terminologyJorge Aparicio-7/+7
2014-11-07syntax: Use UFCS in the expansion of `#[deriving(PartialOrd)]`Jorge Aparicio-4/+25
2014-11-07Purge the old `once_fns`, which are not coming backNiko Matsakis-45/+33
2014-11-07Update parser with `for` syntaxNiko Matsakis-174/+261
2014-11-07rustc: Process #[cfg]/#[cfg_attr] on cratesAlex Crichton-13/+56
This commit implements processing these two attributes at the crate level as well as at the item level. When #[cfg] is applied at the crate level, then the entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute is processed as usual in that the attribute is included or not depending on whether the cfg matches. This was spurred on by motivations of #18585 where #[cfg_attr] annotations will be applied at the crate-level. cc #18585
2014-11-07auto merge of #17830 : pczarn/rust/interp_tt, r=pnkfelixbors-419/+511
Closes #14197 Removes the `matchers` nonterminal. If you're using `$foo:matchers` in a macro, write `$foo:tt` instead. [breaking-change]
2014-11-07Add `ast::SequenceRepetition`Piotr Czarnecki-93/+160
2014-11-06rollup merge of #18630 : nikomatsakis/purge-the-barsAlex Crichton-281/+391
2014-11-06Fallout from collection conventionsAlexis Beingessner-9/+9
2014-11-06Remove the unboxed closure `|:|` notation from types and trait references ↵Niko Matsakis-160/+22
completely.
2014-11-06Support parenthesized paths `Foo(A,B) -> C` that expand to `Foo<(A,B),C>`. ↵Niko Matsakis-103/+285
These paths also bind anonymous regions (or will, once HRTB is fully working). Fixes #18423.
2014-11-06Restructure parsing of paths, which is quite torturedNiko Matsakis-42/+108
2014-11-05Fix fallout of DSTifying PartialEq, PartialOrd, Eq, OrdJorge Aparicio-0/+6
2014-11-05Use operator sugar in the expansion of `#[deriving(PartialEq)]`Jorge Aparicio-5/+31
2014-11-05Workaround to have doc comments desugared only in macrosPiotr Czarnecki-7/+18
2014-11-05Remove `Matcher`sPiotr Czarnecki-156/+33
2014-11-05Use `TokenTree`s in lhs of macrosPiotr Czarnecki-248/+385
2014-11-05Register snapshots.Eduard Burtescu-97/+0
2014-11-04libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` inPatrick Walton-7/+27
Unicode characters and strings. Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected. This PR introduces a new function, `escape_default`, into the ASCII module. This was necessary for the pretty printer to continue to function. RFC #326. Closes #18062. [breaking-change]
2014-11-04Implement flexible target specificationCorey Richardson-64/+10
Removes all target-specific knowledge from rustc. Some targets have changed during this, but none of these should be very visible outside of cross-compilation. The changes make our targets more consistent. iX86-unknown-linux-gnu is now only available as i686-unknown-linux-gnu. We used to accept any value of X greater than 1. i686 was released in 1995, and should encompass the bare minimum of what Rust supports on x86 CPUs. The only two windows targets are now i686-pc-windows-gnu and x86_64-pc-windows-gnu. The iOS target has been renamed from arm-apple-ios to arm-apple-darwin. A complete list of the targets we accept now: arm-apple-darwin arm-linux-androideabi arm-unknown-linux-gnueabi arm-unknown-linux-gnueabihf i686-apple-darwin i686-pc-windows-gnu i686-unknown-freebsd i686-unknown-linux-gnu mips-unknown-linux-gnu mipsel-unknown-linux-gnu x86_64-apple-darwin x86_64-unknown-freebsd x86_64-unknown-linux-gnu x86_64-pc-windows-gnu Closes #16093 [breaking-change]
2014-11-03rollup merge of #18578 : japaric/cloneAlex Crichton-3/+11
2014-11-03rollup merge of #18568 : gamazeps/issue18551Alex Crichton-1/+1
2014-11-03rollup merge of #18562 : nick29581/dxr-1Alex Crichton-17/+16
2014-11-03rollup merge of #18506 : nikomatsakis/assoc-type-boundsAlex Crichton-45/+46
2014-11-03syntax: Use UFCS in the expansion of `#[deriving(Clone)]`Jorge Aparicio-3/+11
2014-11-03rollup merge of #18318 : arielb1/transmute-cleanupAlex Crichton-29/+23