about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2018-06-03implement #[panic_implementation]Jorge Aparicio-0/+9
2018-05-27Ensure every unstable feature has a tracking issue.kennytm-22/+24
2018-05-27Auto merge of #51066 - est31:master, r=sfacklerbors-1/+1
Point to the current box syntax tracking issue The issue was used for both box syntax as well as placement new. It got closed due to placement new being unapproved. So a new one got created for box syntax, yet neither the unstable book nor feature_gate.rs got updated. We are doing this now. r? @aidanhs
2018-05-26Point to the current box syntax tracking issueest31-1/+1
The issue was used for both box syntax as well as placement new. It got closed due to placement new being unapproved. So a new one got created for box syntax, yet neither the unstable book nor feature_gate.rs got updated. We are doing this now.
2018-05-26Auto merge of #51052 - nikomatsakis:obsolete-arrow, r=petrochenkovbors-0/+3
restore emplacement syntax (obsolete) Fix https://github.com/rust-lang/rust/issues/50832 r? @petrochenkov
2018-05-25Implement outlives requirements inference for dyn and projections.toidiu-0/+6
Add tests, documentation and attr for feature.
2018-05-24restore emplacement syntax (obsolete)Niko Matsakis-0/+3
2018-05-22Allow let bindings in const fn and constantsOliver Schneider-0/+3
2018-05-21Remove rustc_serialize_exclude_nullManish Goregaokar-5/+0
2018-05-20Auto merge of #50820 - alexcrichton:no-modules, r=petrochenkovbors-0/+1
rustc: Disallow modules and macros in expansions This commit feature gates generating modules and macro definitions in procedural macro expansions. Custom derive is exempt from this check as it would be a large retroactive breaking change (#50587). It's hoped that we can hopefully stem the bleeding to figure out a better solution here before opening up the floodgates. The restriction here is specifically targeted at surprising hygiene results [1] that result in non-"copy/paste" behavior. Hygiene and procedural macros is intended to be avoided as much as possible for Macros 1.2 by saying everything is "as if you copy/pasted the code", but modules and macros are sort of weird exceptions to this rule that aren't fully fleshed out. [1]: https://github.com/rust-lang/rust/issues/50504#issuecomment-387734625 cc #50504
2018-05-18rustc: Disallow modules and macros in expansionsAlex Crichton-0/+1
This commit feature gates generating modules and macro definitions in procedural macro expansions. Custom derive is exempt from this check as it would be a large retroactive breaking change (#50587). It's hoped that we can hopefully stem the bleeding to figure out a better solution here before opening up the floodgates. The restriction here is specifically targeted at surprising hygiene results [1] that result in non-"copy/paste" behavior. Hygiene and procedural macros is intended to be avoided as much as possible for Macros 1.2 by saying everything is "as if you copy/pasted the code", but modules and macros are sort of weird exceptions to this rule that aren't fully fleshed out. [1]: https://github.com/rust-lang/rust/issues/50504#issuecomment-387734625 cc #50504
2018-05-17Rename trans to codegen everywhere.Irina Popa-2/+2
2018-05-16Add feature gate label_break_valueest31-0/+9
2018-05-15Feature gate trivial boundsMatthew Jasper-0/+3
2018-05-13stabilize :lifetimeAlex Burka-6/+2
2018-05-13Macros: Add a 'literal' fragment specifierDan Aloni-0/+6
Implements RFC 1576. See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md Changes are mostly in libsyntax, docs, and tests. Feature gate is enabled for 1.27.0. Many thanks to Vadim Petrochenkov for following through code reviews and suggestions. Example: ````rust macro_rules! test_literal { ($l:literal) => { println!("literal: {}", $l); }; ($e:expr) => { println!("expr: {}", $e); }; } fn main() { let a = 1; test_literal!(a); test_literal!(2); test_literal!(-3); } ``` Output: ``` expr: 1 literal: 2 literal: -3 ```
2018-05-12rustc: Allow an edition's feature on that editionAlex Crichton-41/+46
This commit fixes a hard error where the `#![feature(rust_2018_preview)]` feature was forbidden to be mentioned when the `--edition 2018` flag was passed. This instead silently accepts that feature gate despite it not being necessary. It's intended that this will help ease the transition into the 2018 edition as users will, for the time being, start off with the `rust_2018_preview` feature and no longer immediately need to remove it. Closes #50662
2018-05-10Remove `nll` from `rust_2018_preview`Alex Crichton-1/+1
NLL isn't quite ready yet so gonna hold off on inserting it into the preview.
2018-05-04Make extern_absolute_paths only work on the new editionManish Goregaokar-2/+4
2018-05-04Make --edition imply the preview flagManish Goregaokar-0/+6
2018-05-04Add catch and proc macros to the edition (fixes #50443)Manish Goregaokar-2/+2
2018-05-02fix testsflip1995-2/+2
2018-05-02make it compile againflip1995-8/+24
2018-05-02Gate tool_attributes featureSeiichi Uchida-1/+4
2018-05-02Remove Option from the return type of Attribute::name()Seiichi Uchida-1/+1
2018-05-01Auto merge of #49982 - petrochenkov:noreex, r=alexcrichtonbors-43/+40
Remove unstable `macro_reexport` It's subsumed by `feature(use_extern_macros)` and `pub use` cc https://github.com/rust-lang/rust/issues/35896 closes https://github.com/rust-lang/rust/issues/29638 closes https://github.com/rust-lang/rust/issues/38951
2018-05-01Auto merge of #49789 - petrochenkov:prelext, r=nikomatsakisbors-1/+4
Module experiments: Add one more prelude layer for extern crate names passed with `--extern` Implements one item from https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/183 When some name is looked up in lexical scope (`name`, i.e. not module-relative scope `some_mod::name` or `::name`), it's searched roughly in the next order: - local variables - items in unnamed blocks - items in the current module - :sparkles: NEW! :sparkles: crate names passed with `--extern` ("extern prelude") - standard library prelude (`Vec`, `drop`) - language prelude (built-in types like `u8`, `str`, etc) The last two layers contain a limited set of names controlled by us and not arbitrary user-defined names like upper layers. We want to be able to add new names into these two layers without breaking user code, so "extern prelude" names have higher priority than std prelude and built-in types. This is a one-time breaking change, that's why it would be nice to run this through crater. Practical impact is expected to be minimal though due to stylistic reasons (there are not many `Uppercase` crates) and due to the way how primitive types are resolved (https://github.com/rust-lang/rust/pull/32131).
2018-05-01Give removal reasons to removed featuresVadim Petrochenkov-36/+40
2018-05-01Remove `macro_reexport`Vadim Petrochenkov-9/+2
It's subsumed by `feature(use_extern_macros)` and `pub use`
2018-04-28stabilize `#[must_use]` for functions and must-use operatorsZack M. Davis-19/+3
This is in the matter of RFC 1940 and tracking issue #43302.
2018-04-28Rollup merge of #49968 - christianpoveda:stabilize_dyn, r=nikomatsakiskennytm-7/+2
Stabilize dyn trait This PR stabilizes RFC 2113. I followed the [stabilization guide](https://forge.rust-lang.org/stabilization-guide.html). Related issue: https://github.com/rust-lang/rust/issues/49218
2018-04-27fixed rustc version for dyn_traitChristian Poveda-1/+1
2018-04-27stop requiring the feature-gate to use dyn_traitChristian Poveda-7/+2
2018-04-27Add one more prelude layer for extern crate names passed with `--extern`Vadim Petrochenkov-1/+4
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-04-24Auto merge of #50096 - alexcrichton:less-simd-warnings, r=michaelwoeristerbors-1/+1
Tweak some warnings around #[target_feature] This commit fixes up some issues discovered when getting the `stdsimd` crate's CI compiling again.
2018-04-24Rollup merge of #49985 - zackmdavis:0, r=estebankkennytm-4/+3
don't see issue #0 The unstable-feature attribute requires an issue (neglecting it is E0547), which gets used in the error messages. Unfortunately, there are some cases where "0" is apparently used a placeholder where no issue exists, directing the user to see the (nonexistent) issue #0. (It would have been better to either let `issue` be optional—compare to how issue is an `Option<u32>` in the feature-gate declarations in libsyntax/feature-gate.rs—or actually require that an issue be created.) Rather than endeavoring to change how `#[unstable]` works at this time (given competing contributor and reviewer priorities), this simple patch proposes the less-ambitious solution of just not adding the "(see issue)" note when the number is zero. Resolves #49983.
2018-04-23Auto merge of #49368 - matthewjasper:feature-gate-where-clause, r=nikomatsakisbors-2/+6
Feature gate where clauses on associated types Fixes #49365. Requires crater: these have been usable since 1.24.
2018-04-22Auto merge of #49757 - GuillaumeGomez:never-search, r=QuietMisdreavusbors-0/+7
Add specific never search Fixes #49529. r? @QuietMisdreavus
2018-04-22Add tracking issue number for doc alias featureGuillaume Gomez-1/+1
2018-04-21Auto merge of #50121 - pnkfelix:revert-stabilization-of-never-type-et-al, ↵bors-0/+7
r=alexcrichton Revert stabilization of never_type (!) et al Fix #49691 I *think* this correctly adopts @nikomatsakis 's desired fix of: * reverting stabilization of `!` and `TryFrom`, and * returning to the previous fallback semantics (i.e. it is once again dependent on whether the crate has opted into `#[feature(never_type)]`, * **without** attempting to put back in the previous future-proofing warnings regarding the change in fallback semantics. (I'll be away from computers for a week starting now, so any updates to this PR should be either pushed into it, or someone else should adopt the task of polishing this fix and put up their own PR.)
2018-04-21Generate alias fileGuillaume Gomez-0/+7
2018-04-20rustc: Tweak custom attribute capabilitiesAlex Crichton-0/+9
This commit starts to lay some groundwork for the stabilization of custom attribute invocations and general procedural macros. It applies a number of changes discussed on [internals] as well as a [recent issue][issue], namely: * The path used to specify a custom attribute must be of length one and cannot be a global path. This'll help future-proof us against any ambiguities and give us more time to settle the precise syntax. In the meantime though a bare identifier can be used and imported to invoke a custom attribute macro. A new feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths and absolute paths. * The set of items which can be annotated by a custom procedural attribute has been restricted. Statements, expressions, and modules are disallowed behind two new feature gates: `proc_macro_expr` and `proc_macro_mod`. * The input to procedural macro attributes has been restricted and adjusted. Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token stream, but after this PR it will only receive `bar` (the delimiters were removed). Invocations like `#[foo]` are still allowed and will be invoked in the same way as `#[foo()]`. This is a **breaking change** for all nightly users as the syntax coming in to procedural macros will be tweaked slightly. * Procedural macros (`foo!()` style) can only be expanded to item-like items by default. A separate feature gate, `proc_macro_non_items`, is required to expand to items like expressions, statements, etc. Closes #50038 [internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252 [issue]: https://github.com/rust-lang/rust/issues/50038
2018-04-20Revert stabilization of `feature(never_type)`.Felix S. Klock II-0/+7
This commit is just covering the feature gate itself and the tests that made direct use of `!` and thus need to opt back into the feature. A follow on commit brings back the other change that motivates the revert: Namely, going back to the old rules for falling back to `()`.
2018-04-19rustc: Blanket whitelist `#[target_feature]`Alex Crichton-1/+1
This commit transitions the `target_feature` attribute from `Normal` to `Whitelisted`. Discovered in #50095 the fact of whether this attribute is used or not is dependent on typechecking running and executing `check_name`, but incremental compilation doesn't currently account for this, meaning that the attribute ends up being flagged as unused when it shouldn't be. I was a little too ambitious it seems hoping that `Normal` could be used, so instead this transitions to `Whitelisted` to be the same as other codegen attributes like `#[inline]` Closes #50095
2018-04-17Auto merge of #49664 - alexcrichton:stable-simd, r=BurntSushibors-11/+16
Stabilize x86/x86_64 SIMD This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably this commit is stabilizing: * The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside. * The `is_x86_feature_detected!` macro in the standard library * The `#[target_feature(enable = "...")]` attribute * The `#[cfg(target_feature = "...")]` matcher Stabilization of the module and intrinsics were primarily done in rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in this commit. The standard library is also tweaked a bit with the new way that stdsimd is integrated. Note that other architectures like `std::arch::arm` are not stabilized as part of this commit, they will likely stabilize in the future after they've been implemented and fleshed out. Similarly the `std::simd` module is also not being stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64` is stabilized in this commit either (MMX), only SSE and up types and intrinsics are stabilized. Closes #29717 Closes #44839 Closes #48556
2018-04-16Separately gate each target_feature featureAlex Crichton-0/+11
Use an explicit whitelist for what features are actually stable and can be enabled.
2018-04-17Remove `underscore_lifetimes` and `match_default_bindings` from active ↵kennytm-6/+0
feature list These are already stabilized in 1.26.
2018-04-16Stabilize x86/x86_64 SIMDAlex Crichton-11/+5
This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably this commit is stabilizing: * The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside. * The `is_x86_feature_detected!` macro in the standard library * The `#[target_feature(enable = "...")]` attribute * The `#[cfg(target_feature = "...")]` matcher Stabilization of the module and intrinsics were primarily done in rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in this commit. The standard library is also tweaked a bit with the new way that stdsimd is integrated. Note that other architectures like `std::arch::arm` are not stabilized as part of this commit, they will likely stabilize in the future after they've been implemented and fleshed out. Similarly the `std::simd` module is also not being stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64` is stabilized in this commit either (MMX), only SSE and up types and intrinsics are stabilized. Closes #29717 Closes #44839 Closes #48556
2018-04-15don't see issue #0Zack M. Davis-4/+3
The unstable-feature attribute requires an issue (neglecting it is E0547), which gets used in the error messages. Unfortunately, there are some cases where "0" is apparently used a placeholder where no issue exists, directing the user to see the (nonexistent) issue #0. (It would have been better to either let `issue` be optional—compare to how issue is an `Option<u32>` in the feature-gate declarations in libsyntax/feature-gate.rs—or actually require that an issue be created.) Rather than endeavoring to change how `#[unstable]` works at this time (given competing contributor and reviewer priorities), this simple patch proposes the less-ambitious solution of just not adding the "(see issue)" note when the number is zero. Resolves #49983.