summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2015-09-13Add an attribute to mark function as unwindingBjörn Steinbrink-0/+4
2015-09-08Auto merge of #28246 - huonw:lang-tracking-issues, r=alexcrichtonbors-90/+117
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
2015-09-08Allow tracking issues for lang features.Huon Wilson-90/+117
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
2015-09-06add MIR code (unused thus far)Niko Matsakis-3/+10
2015-09-03Add an intital HIR and lowering stepNick Cameron-0/+2
2015-08-31Auto merge of #28007 - Ms2ger:FnKind, r=nrcbors-6/+6
There is no longer a need for that pattern, since enums are now qualified.
2015-08-29Handle gateage of built-in attributes seperatelyJonas Schievink-117/+125
This allows marking attributes as whitelisted/crate-only independent of their feature gate status. Closes #24213
2015-08-26Rename FnKind variants and stop re-exporting them from the visit module.Ms2ger-6/+6
There is no longer a need for that pattern, since enums are now qualified.
2015-08-17Rename `simd_basics` feature gate to `repr_simd`.Huon Wilson-6/+3
2015-08-17Create "platform-intrinsic" ABI for SIMD/platform intrinsics.Huon Wilson-4/+13
This is purposely separate to the "rust-intrinsic" ABI, because these intrinsics are theoretically going to become stable, and should be fine to be independent of the compiler/language internals since they're intimately to the platform.
2015-08-17feature gate `cfg(target_feature)`.Huon Wilson-0/+60
This is theoretically a breaking change, but GitHub search turns up no uses of it, and most non-built-in cfg's are passed via cargo features, which look like `feature = "..."`, and hence can't overlap.
2015-08-17Implement `repr(simd)` as an alias for `#[simd]`.Huon Wilson-0/+20
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-0/+4
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-10syntax: Add a new unstable #[linked_from] attributeAlex Crichton-0/+5
To correctly reexport statically included libraries from a DLL on Windows, the compiler will soon need to have knowledge about what symbols are statically included and which are not. To solve this problem a new unstable `#[linked_from]` attribute is being added and recognized on `extern` blocks to indicate which native library the symbols are coming from. The compiler then keeps track of what the set of FFI symbols are that are included statically. This information will be used in a future commit to configure how we invoke the linker on Windows.
2015-08-10Auto merge of #27338 - alexcrichton:remove-morestack, r=brsonbors-1/+3
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow) r? @brson
2015-08-10Remove morestack supportAlex Crichton-1/+3
This commit removes all morestack support from the compiler which entails: * Segmented stacks are no longer emitted in codegen. * We no longer build or distribute libmorestack.a * The `stack_exhausted` lang item is no longer required The only current use of the segmented stack support in LLVM is to detect stack overflow. This is no longer really required, however, because we already have guard pages for all threads and registered signal handlers watching for a segfault on those pages (to print out a stack overflow message). Additionally, major platforms (aka Windows) already don't use morestack. This means that Rust is by default less likely to catch stack overflows because if a function takes up more than one page of stack space it won't hit the guard page. This is what the purpose of morestack was (to catch this case), but it's better served with stack probes which have more cross platform support and no runtime support necessary. Until LLVM supports this for all platform it looks like morestack isn't really buying us much. cc #16012 (still need stack probes) Closes #26458 (a drive-by fix to help diagnostics on stack overflow)
2015-08-06Auto merge of #27296 - jroesch:type-macros, r=huonwbors-0/+6
This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message. @nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.
2015-08-04Address final nitsJared Roesch-2/+4
2015-08-04Add feature gateJared Roesch-2/+6
2015-08-03syntax: Implement #![no_core]Alex Crichton-0/+5
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-29Feature gate associated type defaultsBrian Anderson-1/+8
There are multiple issues with them as designed and implemented. cc #27364
2015-07-29FormattingBrian Anderson-1/+2
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-1/+1
2015-07-25Add omitted trailing commaJared Roesch-1/+1
2015-07-25Add feature gateJared Roesch-2/+7
2015-07-24Add static_recursion feature gate.Eli Friedman-0/+6
2015-07-22Add feature-gates for desugaring-based `box` and placement-`in`.Felix S. Klock II-1/+56
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates. Part of what lands with Issue 22181.
2015-07-22Hack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`.Felix S. Klock II-0/+11
Even after expansion, the generated expressions still track depth of such pushes (i.e. how often you have "pushed" without a corresponding "pop"), and we add a rule that in a context with a positive `push_unsafe!` depth, it is effectively an `unsafe` block context. (This way, we can inject code that uses `unsafe` features, but still contains within it a sub-expression that should inherit the outer safety checking setting, outside of the injected code.) This is a total hack; it not only needs a feature-gate, but probably should be feature-gated forever (if possible). ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs
2015-07-05Feature-gate #[prelude_import].Eduard Burtescu-1/+5
2015-06-18Make a better error message for using #[feature] on stable rustBrian Anderson-1/+38
It now says '#[feature] may not be used on the stable release channel'. I had to convert this error from a lint to a normal compiler error. I left the lint previously-used for this in place since removing it is a breaking change. It will just go unused until the end of time. Fixes #24125
2015-06-17Remove unused emit_feature_warn functionBrian Anderson-12/+0
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-06-03Remove #[static_assert]Steve Klabnik-5/+0
This was always a weird feature, and isn't being used in the compiler. Static assertions should be done better than this. This implements RFC #1096. Fixes #13951 Fixes #23008 Fixes #6676 This is behind a feature gate, but that's still a [breaking-change]
2015-05-29Add feature-gate to calling const fnNiko Matsakis-3/+6
2015-05-24Auto merge of #25609 - nikomatsakis:const-fn, r=pnkfelixbors-2/+28
This is a port of @eddyb's `const-fn` branch. I rebased it, tweaked a few things, and added tests as well as a feature gate. The set of tests is still pretty rudimentary, I'd appreciate suggestions on new tests to write. Also, a double-check that the feature-gate covers all necessary cases. One question: currently, the feature-gate allows the *use* of const functions from stable code, just not the definition. This seems to fit our usual strategy, and implies that we might (perhaps) allow some constant functions in libstd someday, even before stabilizing const-fn, if we were willing to commit to the existence of const fns but found some details of their impl unsatisfactory. r? @pnkfelix
2015-05-24Auto merge of #25168 - Manishearth:register_attr, r=eddybbors-13/+31
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks. cc @thepowersgang
2015-05-21Make various fixes:Niko Matsakis-0/+26
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-2/+2
2015-05-18syntax: Remove unused `packed` attributeklutzy-1/+0
The attribute was removed by #16499.
2015-05-13address more review commentsManish Goregaokar-1/+6
2015-05-07Add support for registering attributes with rustc in pluginsManish Goregaokar-13/+26
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks.
2015-04-28Register new snapshotsTamir Duberstein-6/+0
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-0/+28
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-23Feature-gate associated constants.Sean Patrick Santos-0/+28
2015-04-24Add ')' in `advaced_slice_patterns` error messageLuke Gallagher-1/+1
2015-04-24Add missing '\' for `custom_derive` error messageLuke Gallagher-1/+1
2015-04-16Fix some documentation typosLuke Gallagher-1/+1
2015-04-15Auto merge of #24436 - fhahn:fix-small-typo, r=steveklabnikbors-1/+1
2015-04-14Remove superfluous `the` from `custom_attribute` feature gate messageFlorian Hahn-1/+1
2015-04-14Expose visibility for fns in syntax::visitNick Cameron-3/+3