about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-2/+2
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-22/+20
2015-02-17rollup merge of #22024: alexcrichton/asciiAlex Crichton-6/+4
* Move the type parameter on the `AsciiExt` trait to an associated type named `Owned`. * Move `ascii::escape_default` to using an iterator. This is a breaking change due to the removal of the type parameter on the `AsciiExt` trait as well as the modifications to the `escape_default` function to returning an iterator. Manual implementations of `AsciiExt` (or `AsciiExt` bounds) should be adjusted to remove the type parameter and using the new `escape_default` should be relatively straightforward. [breaking-change]
2015-02-17std: Rename io/path features with old_ prefixAlex Crichton-2/+2
This commit renames the features for the `std::old_io` and `std::old_path` modules to `old_io` and `old_path` to help facilitate migration to the new APIs. This is a breaking change as crates which mention the old feature names now need to be renamed to use the new feature names. [breaking-change]
2015-02-17std: Stabilize the `ascii` moduleAlex Crichton-6/+4
This commit performs a stabilization pass over the `std::ascii` module taking the following actions: * the module name is now stable * `AsciiExt` is now stable after moving its type parameter to an `Owned` associated type * `AsciiExt::is_ascii` is now stable * `AsciiExt::to_ascii_uppercase` is now stable * `AsciiExt::to_ascii_lowercase` is now stable * `AsciiExt::eq_ignore_ascii_case` is now stable * `AsciiExt::make_ascii_uppercase` is added to possibly replace `OwnedAsciiExt::into_ascii_uppercase` (similarly for lowercase variants). * `escape_default` now returns an iterator and is stable * `EscapeDefault` is now stable Trait implementations are now also marked stable. Primarily it is still unstable to *implement* the `AsciiExt` trait due to it containing some unstable methods. [breaking-change]
2015-02-17Rollup merge of #22383 - pnkfelix:pass-features-along-during-expansion, r=huonwManish Goregaokar-27/+129
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-17Rollup merge of #22364 - Manishearth:rfc-572-forbid-attr, r=nikomatsakisManish Goregaokar-40/+159
fixes #22203 r? @nikomatsakis This breaks code that might be using attributes randomly, so it's technically a [breaking-change]
2015-02-17Add gating for rustc_* attrsManish Goregaokar-13/+30
2015-02-17move other attribute check to visit_attributeManish Goregaokar-20/+10
2015-02-17Add `Gated` attribute typeManish Goregaokar-28/+28
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-16Clean up visit_attribute in feature_gate.rsManish Goregaokar-37/+26
- We shouldn't be using `check_name` here at all - `contains_name(ref_slice(foo), bar)` is redundant, `contains_name` just iterates over its first arg and calls `check_name` - match would be better than a bunch of ifs
2015-02-16Feature gate custom attributes (fixes #22203)Manish Goregaokar-0/+54
2015-02-16Move ATTRIBUTE_WHITELIST and CRATE_ATTRS to KNOWN_ATTRIBUTES in ↵Manish Goregaokar-0/+69
syntax::feature_gate
2015-02-16Address the other cases of #22234; fix #22234.Felix S. Klock II-6/+80
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-6/+25
2015-02-15libsyntax: Pass feature set in ExpansionConfig, not just enable_quotes.Felix S. Klock II-16/+25
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-1/+0
2015-02-15Rollup merge of #22285 - kmcallister:pub-macro, r=nick29581Manish Goregaokar-0/+18
It's not clear what this means, because a macro in item position can expand to zero or more items. For now we disallow it, which is technically a [breaking-change] but is landing without an RFC. The `pub` keyword previously had no effect, which seems quite unintended. Fixes #18317. Fixes #14660.
2015-02-15Rollup merge of #22300 - kmcallister:pub-method-macro, r=sfacklerManish Goregaokar-2/+1
Fixes #17436.
2015-02-15Rollup merge of #22339 - petrochenkov:int, r=huonwManish Goregaokar-1/+1
Some function signatures have changed, so this is a [breaking-change]. In particular, radixes and numerical values of digits are represented by `u32` now. Part of #22240
2015-02-15Rollup merge of #22277 - pnkfelix:reference-update-feature-gate-list, ↵Manish Goregaokar-0/+1
r=steveklabnik Added all active features to the list in reference.md. Added a second note about keeping the reference.md list up-to-date to the bottom of the list, since not everyone (including me) reads the big comment at the top of it. :) Ensured that the feature gate list in reference.md is kept in alphabetical order.
2015-02-15Rollup merge of #22274 - pnkfelix:retag-slicing-syntax-as-accepted, ↵Manish Goregaokar-1/+1
r=nikomatsakis Re-tag `slicing_syntax` as `Accepted`. Rollup merge (373cbab5b08d6630da58f28d2166c19afc327fa6) of PR #20723 accidentally reverted a portion of commit 8327bcc167661c26ca5c6b967309ff745d302329 which shifted `slicing_syntax` from Active to Accepted.
2015-02-15Fix the falloutVadim Petrochenkov-1/+1
2015-02-14Auto merge of #22158 - Kimundi:the_lonely_uppercase_keyword, r=pnkfelixbors-39/+73
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-13Forbid `pub mymacro!();`Keegan McAllister-0/+18
It's not clear what this means, because a macro in item position can expand to zero or more items. For now we disallow it, which is technically a [breaking-change] but is landing without an RFC. The `pub` keyword previously had no effect, which seems quite unintended. Fixes #18317. Fixes #14660.
2015-02-13Parse `pub` in the expansion of a method macroKeegan McAllister-2/+1
Fixes #17436.
2015-02-13Added all active features to the list in reference.md.Felix S. Klock II-0/+1
Added a second note about keeping the reference.md list up-to-date to the bottom of the list, since not everyone (including me) reads the big comment at the top of it. :) Ensured that the feature gate list in reference.md is kept in alphabetical order.
2015-02-13Re-tag `slicing_syntax` as `Accepted`.Felix S. Klock II-1/+1
Rollup merge (373cbab5b08d6630da58f28d2166c19afc327fa6) of PR #20723 accidentally reverted a portion of commit 8327bcc167661c26ca5c6b967309ff745d302329 which shifted `slicing_syntax` from Active to Accepted.
2015-02-12Made `Self` a keyword.Marvin Löbel-39/+73
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-12Update metadata to reflect that predicates/schemes/trait-defs are now severedNiko Matsakis-0/+8
2015-02-11bitrig integrationDave Huseby-0/+2
2015-02-11rollup merge of #22178: pnkfelix/featuregate-unsafe-no-drop-flagAlex Crichton-0/+10
Conflicts: src/libsyntax/feature_gate.rs
2015-02-11rollup merge of #22188: alexcrichton/envv2Alex 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-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-11rustc: Fix a number of stability lint holesAlex Crichton-17/+5
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-02-11Generalize all error messages with "experimental in alpha release" toFelix S. Klock II-1/+1
just say "experimental."
2015-02-11Feature-gate the `#[unsafe_no_drop_flag]` attribute.Felix S. Klock II-0/+10
See RFC 320, "Non-zeroing dynamic drops." Fix #22173 [breaking-change]
2015-02-11generalize error text to not focus on any particular release.Felix S. Klock II-1/+1
2015-02-11Opt into new `box_patterns` feature gate in various crates.Felix S. Klock II-0/+1
Namely: `collections` (used in `dlist.rs`), `syntax`, `rustc`, `rustc_typeck`, `rustc_trans`, and `rustdoc`.
2015-02-11Add `box_patterns` feature gate.Felix S. Klock II-1/+4
Switch feature-gate checker from `box_syntax` to `box_patterns` when visiting a pattern. (Having to opt into both `box_syntax` and `box_patterns` seemed unnecessary.) [breaking-change]
2015-02-10rollup merge of #22116: kmcallister/cfg_attrAlex Crichton-54/+68
Fixes #22070. Fixes #19372. r? @sfackler
2015-02-10rollup merge of #22103: pczarn/fix-ice-22091Alex Crichton-2/+9
Fixes #22091 I'm not sure how to write a test for this. An ICE happens with spans that start near (after?) a null character or some other zero-width unicode character.
2015-02-10rollup merge of #22094: alkor/cleanup-show-stringAlex Crichton-1/+0
Rename several remaining `Show`s to Debug, `String`s to Display (mostly in comments and docs). Update reference.md: - derive() no longer supports Zero trait - derive() now supports Copy trait
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-10rollup merge of #21918: ranma42/replace-beAlex Crichton-1/+1
Conflicts: src/test/compile-fail/reserved-be.rs src/test/compile-fail/reserved-become.rs src/test/parse-fail/reserved-be.rs
2015-02-10Auto merge of #22026 - kmcallister:plugin, r=sfacklerbors-5/+5
```rust #[plugin] #[no_link] extern crate bleh; ``` becomes a crate attribute ```rust #![plugin(bleh)] ``` The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]
2015-02-10Auto merge of #21961 - nick29581:hrl-syntax, r=nmatsakisbors-15/+52
Closes # 20022 r? @nikomatsakis
2015-02-10TestsNick Cameron-4/+10
2015-02-09Use a crate attribute to load pluginsKeegan McAllister-5/+5
#[plugin] #[no_link] extern crate bleh; becomes a crate attribute #![plugin(bleh)] The feature gate is still required. It's almost never correct to link a plugin into the resulting library / executable, because it will bring all of libsyntax and librustc with it. However if you really want this behavior, you can get it with a separate `extern crate` item in addition to the `plugin` attribute. Fixes #21043. Fixes #20769. [breaking-change]