about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2015-02-24Auto merge of #21689 - FlaPer87:oibit-send-and-friends, r=nikomatsakisbors-1/+1
This is one more step towards completing #13231 This series of commits add support for default trait implementations. The changes in this PR don't break existing code and they are expected to preserve the existing behavior in the compiler as far as built-in bounds checks go. The PR adds negative implementations of `Send`/`Sync` for some types and it removes the special cases for `Send`/`Sync` during the trait obligations checks. That is, it now fully relies on the traits check rather than lang items. Once this patch lands and a new snapshot is created, it'll be possible to add default impls for `Send` and `Sync` and remove entirely the use of `BuiltinBound::{BoundSend,BoundSync}` for positive implementations as well. This PR also removes the restriction on negative implementations. That is, it is now possible to add negative implementations for traits other than `Send`/`Sync`
2015-02-23int audit - libcore::fmtNick Cameron-2/+6
2015-02-23Auto merge of #21769 - brooksbp:column-line-macro, r=nick29581bors-2/+7
Please see discussion in #19284 .
2015-02-22Add support for default trait impls in libsyntaxFlavio Percoco-1/+1
2015-02-21Resolve barriers to changing column!() / line!() return type to u32 in ↵Brian Brooks-0/+4
#19284 . Address review comments in #21769 .
2015-02-22Fix errors from #22592Manish Goregaokar-1/+1
2015-02-21Resolve includeme.fragment conflict.Brian Brooks-5/+6
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-60/+59
where possible.
2015-02-18Round 3 test fixes and conflictsAlex Crichton-11/+11
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-56/+56
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-56/+56
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-1/+1
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18rollup merge of #22480: alexcrichton/hashv3Alex Crichton-15/+10
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18rollup merge of #22287: Ryman/purge_carthographersAlex Crichton-9/+9
This overlaps with #22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary. This also implements `RandomAccessIterator` for `iter::Cloned` cc @steveklabnik, you may want to glance at this before #22281 gets the bors treatment
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-15/+10
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-1/+1
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-9/+9
2015-02-17Rollup merge of #22383 - pnkfelix:pass-features-along-during-expansion, r=huonwManish Goregaokar-16/+87
Pass features along during expansion Use the set of passed features to detect uses of feature-gated macros without the corresponding feature enabled. Fix #22234. ---- Also, the framework this add (passing along a reference to the features in the expansion context) is a necessary precursor for landing a properly feature-gated desugaring-based overloaded-`box` and placement-`in` (#22181). ---- This is fixing a bug, but since there might be code out there that is unknowingly taking advantage of that bug, I feel obligated to mark this as a: [breaking-change]
2015-02-16Fix fallout in libsyntax from RFC 599. Clarity and efficiency seems to be ↵Niko Matsakis-9/+10
mostly improved, to my eye. Nonetheless, as this commit demonstrates, the previous commits was a [breaking-change]. In practice, breakage is focused on functions of this form: ```rust fn foo(..., object: Box<FnMut()>) ```` where `FnMut()` could be any trait object type. The older scheme defaulted objects in argument position so that they were bounded by a fresh lifetime: ```rust fn foo<'a>(..., object: Box<FnMut()+'a>) ``` This meant that the object could contain borrowed data. The newer scheme defaults to a lifetime bound of `'static`: ```rust fn foo(..., object: Box<FnMut()+'static>) ``` This means that the object cannot contain borrowed data. In some cases, the best fix is to stop using `Box`: ```rust fn foo(..., object: &mut FnMut()) ``` but another option is to write an explicit annotation for the `'a` lifetime that used to be implicit. Both fixes are demonstrated in this commit.
2015-02-16Address the other cases of #22234; fix #22234.Felix S. Klock II-0/+48
The other cases: `concat_idents!`, `log_syntax!`, and `trace_macros!`, (these macros, with `asm!`, are handled (eagerly) in feature_gate.rs).
2015-02-15Address the `asm!` case of #22234.Felix S. Klock II-1/+15
2015-02-15libsyntax: Pass feature set in ExpansionConfig, not just enable_quotes.Felix S. Klock II-16/+25
2015-02-15Rollup merge of #22300 - kmcallister:pub-method-macro, r=sfacklerManish Goregaokar-2/+1
Fixes #17436.
2015-02-14Auto merge of #22158 - Kimundi:the_lonely_uppercase_keyword, r=pnkfelixbors-14/+14
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
2015-02-13Parse `pub` in the expansion of a method macroKeegan McAllister-2/+1
Fixes #17436.
2015-02-12Made `Self` a keyword.Marvin Löbel-14/+14
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
2015-02-11std: Tweak the std::env OsString/String interfaceAlex Crichton-2/+2
This commit tweaks the interface of the `std::env` module to make it more ergonomic for common usage: * `env::var` was renamed to `env::var_os` * `env::var_string` was renamed to `env::var` * `env::args` was renamed to `env::args_os` * `env::args` was re-added as a panicking iterator over string values * `env::vars` was renamed to `env::vars_os` * `env::vars` was re-added as a panicking iterator over string values. This should make common usage (e.g. unicode values everywhere) more ergonomic as well as "the default". This is also a breaking change due to the differences of what's yielded from each of these functions, but migration should be fairly easy as the defaults operate over `String` which is a common type to use. [breaking-change]
2015-02-10rollup merge of #22116: kmcallister/cfg_attrAlex Crichton-38/+2
Fixes #22070. Fixes #19372. r? @sfackler
2015-02-10rollup merge of #21943: hugwijst/extctxt_ufcsAlex Crichton-0/+56
Add `QPath` construction support to `ExtCtxt`. Allows compiler plugins to generate calls with UFCS.
2015-02-09Process cfg_attr right before stripping cfgKeegan McAllister-36/+0
Fixes #22070. Fixes #19372.
2015-02-09syntax::fold: Allow removing attributesKeegan McAllister-2/+2
2015-02-09Accept quantification of lifetimes outside the self type in where clauses.Nick Cameron-4/+6
Closes #20022
2015-02-08Auto merge of #22054 - LeoTestard:include-parse-errors, r=alexcrichtonbors-2/+6
Makes the compilation abort when a parse error is encountered while trying to parse an item in an included file. The previous behaviour was to stop processing the file when a token that can't start an item was encountered, without producing any error. Fixes #21146.
2015-02-08Auto merge of #21988 - kmcallister:no-std, r=sfacklerbors-62/+131
Fixes #21833. [breaking-change] r? @alexcrichton The tests in #21912 will also need `#[feature(no_std)]`. If you're okay with both PRs, I can merge and test them.
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-54/+113
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Use path helper macros in derivingKeegan McAllister-28/+38
2015-02-07Auto merge of #21984 - pnkfelix:make-for-loops-a-terminating-scope, ↵bors-8/+20
r=nikomatsakis make `for PAT in ITER_EXPR { ... }` a terminating-scope for ITER_EXPR. In effect, temporary anonymous values created during the evaluation of ITER_EXPR no longer not live for the entirety of the block surrounding the for-loop; instead they only live for the extent of the for-loop itself, and no longer. ---- There is one case I know of that this breaks, demonstrated to me by @nikomatsakis (but it is also a corner-case that is useless in practice). Here is that case: ``` fn main() { let mut foo: Vec<&i8> = Vec::new(); for i in &[1, 2, 3] { foo.push(i) } } ``` Note that if you add any code following the for-loop above, or even a semicolon to the end of it, then the code will stop compiling (i.e., it gathers a vector of references but the gathered vector cannot actually be used.) (The above code, despite being useless, did occur in one run-pass test by accident; that test is updated here to accommodate the new striction.) ---- So, technically this is a: [breaking-change]
2015-02-07Fix handling of parse errors when using `include!()`.Leo Testard-2/+6
Makes the compilation abort when a parse error is encountered while trying to parse an item in an included file. The previous behaviour was to stop processing the file when a token that can't start an item was encountered, without producing any error. Fixes #21146.
2015-02-06librustdoc has been updatedGuillaumeGomez-3/+3
Fixes run build error Fix test failure Fix tests' errors
2015-02-06Remove getenv warningGuillaumeGomez-4/+3
2015-02-06Update to last version, remove "[]" as much as possibleGuillaumeGomez-23/+23
2015-02-06Libsyntax has been updatedGuillaumeGomez-64/+44
2015-02-06Update HEAD:masterGuillaumeGomez-1/+1
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-44/+66
2015-02-06make `for PAT in ITER_EXPR { ... }` a terminating-scope for ITER_EXPR.Felix S. Klock II-8/+20
In effect, temporary anonymous values created during the evaluation of ITER_EXPR no longer not live for the entirety of the block surrounding the for-loop; instead they only live for the extent of the for-loop itself, and no longer. ---- There is one case I know of that this breaks, demonstrated to me by niko (but it is also a corner-case that is useless in practice). Here is that case: ``` fn main() { let mut foo: Vec<&i8> = Vec::new(); for i in &[1, 2, 3] { foo.push(i) } } ``` Note that if you add any code following the for-loop above, or even a semicolon to the end of it, then the code will stop compiling (i.e., it gathers a vector of references but the gathered vector cannot actually be used.) (The above code, despite being useless, did occur in one run-pass test by accident; that test is updated here to accommodate the new striction.) ---- So, technically this is a: [breaking-change]
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-18/+18
2015-02-04remove all kind annotations from closuresJorge Aparicio-12/+12
2015-02-04Add QPath construction to ExtCtxt for UFCS support.Hugo van der Wijst-0/+56
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-0/+4
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-0/+4
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]