about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2015-01-05Allow selective macro importKeegan McAllister-2/+5
2015-01-05Move #[macro_reexport] to extern crateKeegan McAllister-59/+14
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-33/+29
2015-01-05Reformat metadata for exported macrosKeegan McAllister-72/+34
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-05Rename macro_escape to macro_useKeegan McAllister-18/+27
In the future we want to support #[macro_use(foo, bar)] mod macros; but it's not an essential part of macro reform. Reserve the syntax for now.
2015-01-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-2/+2
2015-01-05Implement macro re-exportKeegan McAllister-1/+49
Fixes #17103.
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-6/+43
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-57/+30
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2015-01-05Ungate default type parameters.Huon Wilson-15/+7
These are in scope for 1.0, and this is good to e.g. find as many bugs as possible.
2015-01-04serialize: Use assoc types + less old_orphan_checkAlex Crichton-30/+32
This commit moves the libserialize crate (and will force the hand of the rustc-serialize crate) to not require the `old_orphan_check` feature gate as well as using associated types wherever possible. Concretely, the following changes were made: * The error type of `Encoder` and `Decoder` is now an associated type, meaning that these traits have no type parameters. * The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable` traits have moved to the corresponding method of the trait. This movement alleviates the dependency on `old_orphan_check` but implies that implementations can no longer be specialized for the type of encoder/decoder being implemented. Due to the trait definitions changing, this is a: [breaking-change]
2015-01-05Change `&` pat to only work with &T, and `&mut` with &mut T.Huon Wilson-1/+1
This implements RFC 179 by making the pattern `&<pat>` require matching against a variable of type `&T`, and introducing the pattern `&mut <pat>` which only works with variables of type `&mut T`. The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match through a `&T` or a `&mut T` that binds the variable `x` to have type `T` and to be mutable. This should be rewritten as follows, for example, for &mut x in slice.iter() { becomes for &x in slice.iter() { let mut x = x; Due to this, this is a [breaking-change] Closes #20496.
2015-01-05auto merge of #20285 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakisbors-1/+2
This commit introduces the syntax for negative implementations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC rust-lang/rfcs#127 r? @nikomatsakis
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-1/+2
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3
2015-01-04[breaking change] Update entry API as part of RFC 509.Ben Foppa-11/+8
2015-01-03Remove deprecated functionalityAlex Crichton-104/+0
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-26/+26
2015-01-03sed -i -s 's/\bmod}/self}/g' **/*.rsJorge Aparicio-1/+1
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2015-01-03use assoc types in binop traitsJorge Aparicio-1/+3
2015-01-03syntax: fix falloutJorge Aparicio-1/+1
2015-01-02Merge remote-tracking branch 'origin/master' into rollupAlex Crichton-22/+34
Conflicts: src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
2015-01-02rollup merge of #20425: sanxiyn/opt-local-tyAlex Crichton-3/+3
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-02std: Stabilize the prelude moduleAlex Crichton-3/+1
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2015-01-02Make type in ast::Local optionalSeo Sanghyeon-3/+3
2015-01-02Accept `derive` instead of `deriving`Nick Cameron-22/+34
[breaking-change] `deriving is still accepted, but gives a deprecation warning
2014-12-31syntax: unbox closures used in let bindingsJorge Aparicio-7/+7
2014-12-31syntax: unbox closures used in function argumentsJorge Aparicio-6/+6
2014-12-30Fallout from stabilizationAaron Turon-12/+11
2014-12-29rollup merge of #20194: nick29581/dst-syntaxAlex Crichton-18/+16
Part of #19607. r? @nikomatsakis
2014-12-29Slash the ast::Stmt type from 104 to 24 bytes.Huon Wilson-1/+1
(on platforms with 64-bit pointers.) The StmtMac variant is rather large and also fairly rare, so let's optimise the common case.
2014-12-28auto merge of #20136 : eddyb/rust/format-args, r=alexcrichtonbors-147/+99
We have the technology: no longer do you need to write closures to use `format_args!`. This is a `[breaking-change]`, as it forces you to clean up old hacks - if you had code like this: ```rust format_args!(fmt::format, "{} {} {}", a, b, c) format_args!(|args| { w.write_fmt(args) }, "{} {} {}", x, y, z) ``` change it to this: ```rust fmt::format(format_args!("{} {} {}", a, b, c)) w.write_fmt(format_args!("{} {} {}", x, y, z)) ``` To allow them to be called with `format_args!(...)` directly, several functions were modified to take `fmt::Arguments` by value instead of by reference. Also, `fmt::Arguments` derives `Copy` now in order to preserve all usecases that were previously possible.
2014-12-27syntax: change format_args! to produce fmt::Arguments instead of calling a ↵Eduard Burtescu-66/+29
function with them.
2014-12-27syntax: use std::string::String unqualified in format.Eduard Burtescu-13/+12
2014-12-27syntax: turn the match-call generated by format_args inside-out.Eduard Burtescu-39/+41
2014-12-27syntax: format: put static arrays in their own blocks to avoid needing a ↵Eduard Burtescu-40/+39
wrapper block.
2014-12-27syntax: format: remove unused method_statics field.Eduard Burtescu-15/+4
2014-12-27auto merge of #19916 : SimonSapin/rust/ascii-reform, r=sfacklerbors-0/+1
Implements [RFC 486](https://github.com/rust-lang/rfcs/pull/486). Fixes #19908. * Rename `to_ascii_{lower,upper}` to `to_ascii_{lower,upper}case`, per #14401 * Remove the `Ascii` type and associated traits: `AsciiCast`, `OwnedAsciiCast`, `AsciiStr`, `IntoBytes`, and `IntoString`. * As a replacement, add `.is_ascii()` to `AsciiExt`, and implement `AsciiExt` for `u8` and `char`. [breaking-change]
2014-12-26Keep track of the whole error chainFlavio Percoco-2/+5
2014-12-26Accept `?Sized` as well as `Sized?`Nick Cameron-18/+16
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-25Remove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.Simon Sapin-0/+1
As a replacement, add is_ascii() to AsciiExt, and implement AsciiExt for u8 and char. [breaking-change]
2014-12-23Rename include_bin! to include_bytes!Chris Wong-1/+10
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway. We keep the old name around for now, but trigger a deprecation warning when it is used. [RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md [breaking-change]
2014-12-22rollup merge of #19891: nikomatsakis/unique-fn-types-3Alex Crichton-9/+19
Conflicts: src/libcore/str.rs src/librustc_trans/trans/closure.rs src/librustc_typeck/collect.rs src/libstd/path/posix.rs src/libstd/path/windows.rs
2014-12-22rollup merge of #20056: MrFloya/iter_renameAlex Crichton-1/+1
Conflicts: src/libcollections/bit.rs src/libcore/str.rs
2014-12-22rollup merge of #20033: alexcrichton/deprecate-serialiseAlex Crichton-18/+59
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-22Fix fallout from changes. In cases where stage0 compiler is needed, weNiko Matsakis-9/+19
cannot use an `as` expression to coerce, so I used a one-off function instead (this is a no-op in stage0, but in stage1+ it triggers coercion from the fn pointer to the fn item type).
2014-12-22Renaming of the Iter types as in RFC #344Florian Wilkens-1/+1
libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut This is of course a [breaking-change].
2014-12-22serialize: Fully deprecate the libraryAlex Crichton-18/+59
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-128/+116
2014-12-21rollup merge of #19972: alexcrichton/snapshotsAlex Crichton-24/+0
Conflicts: src/libcollections/string.rs src/libcollections/vec.rs src/snapshots.txt