summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2016-11-03Allow bootstrapping without a key. Fixes #36548Brian Anderson-9/+6
This will make it easier for packagers to bootstrap rustc when they happen to have a bootstrap compiler with a slightly different version number. It's not ok for anything other than the build system to set this environment variable.
2016-10-19Stabilise `?`Nick Cameron-6/+2
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-09-26emit feature help in cheat modeTim Neumann-6/+5
2016-09-26make is_nightly_build a method on UnstableFeaturesTim Neumann-0/+7
2016-09-26add unstable_features to ParseSessTim Neumann-0/+18
2016-09-26make emit_feature_err take a ParseSessTim Neumann-11/+13
2016-09-23ICH: Add ability to test the ICH of exported metadata items.Michael Woerister-0/+10
2016-09-12crate-ify compiler-rt into compiler-builtinsJorge Aparicio-0/+10
libcompiler-rt.a is dead, long live libcompiler-builtins.rlib This commit moves the logic that used to build libcompiler-rt.a into a compiler-builtins crate on top of the core crate and below the std crate. This new crate still compiles the compiler-rt instrinsics using gcc-rs but produces an .rlib instead of a static library. Also, with this commit rustc no longer passes -lcompiler-rt to the linker. This effectively makes the "no-compiler-rt" field of target specifications a no-op. Users of `no_std` will have to explicitly add the compiler-builtins crate to their crate dependency graph *if* they need the compiler-rt intrinsics. Users of the `std` have to do nothing extra as the std crate depends on compiler-builtins. Finally, this a step towards lazy compilation of std with Cargo as the compiler-rt intrinsics can now be built by Cargo instead of having to be supplied by the user by some other method. closes #34400
2016-09-07add static_in_const feature gateAndre Bogus-0/+3
also updates tests and deletes the spurious .bk files I inadvertently added last time.
2016-09-05Rollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1Manish Goregaokar-0/+1
Add back feature accidentally removed This feature was accidentally removed in https://github.com/rust-lang/rust/pull/35957.
2016-09-03Add back feature accidentally removedAlex Crichton-0/+1
This feature was accidentally removed in https://github.com/rust-lang/rust/pull/35957.
2016-09-03Translate union constantsVadim Petrochenkov-1/+1
Fix alignment for packed unions Add some missing privacy test Get rid of `unimplemented_unions` macro
2016-09-03Lower unions from AST to HIR and from HIR to typesVadim Petrochenkov-0/+9
Parse union items and add a feature for them
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-6/+18
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2016-09-01Add `item_like_imports` feature.Jeffrey Seyfried-1/+4
2016-08-31Add a tracking issue to the feature gate of the sysv64 ABICensoredUsername-1/+1
2016-08-30Feature gate the sysv64 abi as feature(abi_sysv64) and add testsCensoredUsername-7/+16
2016-08-28Rollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrcJeffrey Seyfried-1/+1
syntax: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`
2016-08-28Rollup merge of #35850 - SergioBenitez:master, r=nrcJeffrey Seyfried-13/+38
Implement RFC#1559: allow all literals in attributes Implemented rust-lang/rfcs#1559, tracked by #34981.
2016-08-27Change Constness to Spanned<Constness>Keith Yeung-4/+4
2016-08-26Stabilize type-macrosDaniele Baracchi-3/+2
Closes #27245
2016-08-25Refactor away `AttrMetaMethods`.Jeffrey Seyfried-1/+1
2016-08-25Refactor away `AttrNestedMetaItemMethods`.Jeffrey Seyfried-1/+1
2016-08-25Implement RFC#1559: allow all literals in attributes.Sergio Benitez-13/+38
2016-08-24Remove drop flags from structs and enums implementing Drop.Eduard Burtescu-9/+2
2016-08-24Disable old trans access via -Z orbit, #[rustc_no_mir] or --disable-orbit.Eduard Burtescu-5/+0
2016-08-16Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakisbors-1/+18
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-15Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakisbors-1/+1
Take commandline arguments into account for incr. comp. Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727. From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples. The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct. One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data. It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map. Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.
2016-08-14Rollup merge of #35606 - Mark-Simulacrum:no-std-fix, r=brsonEduard-Mihai Burtescu-1/+1
Change stabilization version of no_std from 1.0 to 1.6. I don't know if more than this is needed. Fixes #35579.
2016-08-13Fix bug in PostExpansionVisitorAndrew Cann-1/+1
2016-08-13Rename empty/bang to neverAndrew Cann-4/+4
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Control usage of `!` through a feature gate.Andrew Cann-1/+18
Adds the `bang_type` feature gate. `!` in a non-return-type position now relies on that feature.
2016-08-13Remove restrictions from tuple structs/variantsVadim Petrochenkov-4/+20
Hard errors are turned into feature gates
2016-08-12syntax: add anonymized type syntax, i.e. impl TraitA+TraitB.Eduard Burtescu-1/+8
2016-08-11Change stabilization version of no_std from 1.0 to 1.6.Mark-Simulacrum-1/+1
2016-08-11Add the notion of a dependency tracking status to commandline arguments.Michael Woerister-1/+1
Commandline arguments influence whether incremental compilation can use its compilation cache and thus their changes relative to previous compilation sessions need to be taking into account. This commit makes sure that one has to specify for every commandline argument whether it influences incremental compilation or not.
2016-07-30Auto merge of #34904 - petrochenkov:rustcall, r=nikomatsakisbors-32/+41
Properly feature gate all unstable ABIs Fixes https://github.com/rust-lang/rust/issues/34900 [breaking-change] r? @pnkfelix --- Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind https://github.com/rust-lang/rust/issues/34900. I'll try to restructure these visitors a bit and send one more PR later.
2016-07-29Auto merge of #34842 - cgswords:attr_enc, r=nrcbors-8/+7
Better attribute and metaitem encapsulation throughout the compiler This PR refactors most (hopefully all?) of the `MetaItem` interactions outside of `libsyntax` (and a few inside) to interact with MetaItems through the provided traits instead of directly creating / destruct / matching against them. This is a necessary first step to eventually converting `MetaItem`s to internally use `TokenStream` representations (which will make `MetaItem` interactions much nicer for macro writers once the new macro system is in place). r? @nrc
2016-07-28Add a testing mechanism and a simple spike testNiko Matsakis-0/+10
2016-07-25General MetaItem encapsulation rewrites.cgswords-8/+7
2016-07-18Properly feature gate all unstable ABIsVadim Petrochenkov-32/+41
2016-06-29Fix testsggomez-1/+1
2016-06-29Add error codes in libsyntaxggomez-9/+8
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-7/+7
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-3/+3
2016-06-16Simplify gated cfg checkingJeffrey Seyfried-71/+20
2016-06-14Remove the type parameter from `syntax::visit::Visitor`Jeffrey Seyfried-7/+7
2016-06-05Respect #[rustc_inherit_overflow_checks] in mir::build and trans.Eduard Burtescu-0/+7
2016-06-01Auto merge of #33794 - petrochenkov:sanity, r=nrcbors-29/+3
Add AST validation pass and move some checks to it The purpose of this pass is to catch constructions that fit into AST data structures, but not permitted by the language. As an example, `impl`s don't have visibilities, but for convenience and uniformity with other items they are represented with a structure `Item` which has `Visibility` field. This pass is intended to run after expansion of macros and syntax extensions (and before lowering to HIR), so it can catch erroneous constructions that were generated by them. This pass allows to remove ad hoc semantic checks from the parser, which can be overruled by syntax extensions and occasionally macros. The checks can be put here if they are simple, local, don't require results of any complex analysis like name resolution or type checking and maybe don't logically fall into other passes. I expect most of errors generated by this pass to be non-fatal and allowing the compilation to proceed. I intend to move some more checks to this pass later and maybe extend it with new checks, like, for example, identifier validity. Given that syntax extensions are going to be stabilized in the measurable future, it's important that they would not be able to subvert usual language rules. In this patch I've added two new checks - a check for labels named `'static` and a check for lifetimes and labels named `'_`. The first one gives a hard error, the second one - a future compatibility warning. Fixes https://github.com/rust-lang/rust/issues/33059 ([breaking-change]) cc https://github.com/rust-lang/rfcs/pull/1177 r? @nrc
2016-05-30stable features lint warning mentions version stabilizedZack M. Davis-3/+7
To accomplish this, we alter the checks in `rustc::middle::stability` to use the `StabilityLevel` defined in `syntax::attr` (which includes the version in which the feature was stabilized) rather than the local `StabilityLevel` in the same module, and make the `declared_stable_lang_features` field of `syntax::feature_gate::Features` hold a Vec of feature-name, span tuples (in analogy to the `declared_lib_features` field) rather than just spans. This is in the matter of issue #33394.