about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2017-09-19Auto merge of #44026 - QuietMisdreavus:trimmed-std, r=steveklabnikbors-0/+6
hide internal types/traits from std docs via new #[doc(masked)] attribute Fixes #43701 (hopefully for good this time) This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs. Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter. To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.
2017-09-13honor #[rustc_const_unstable] attributesAlex Burka-0/+6
2017-09-13Auto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakisbors-3/+2
Stabilize drop_types_in_const. Closes #33156, stabilizing the new, revised, rules, and improving the error message. r? @nikomatsakis cc @SergioBenitez
2017-09-10Rollup merge of #44262 - alexcrichton:repr-128-gate, r=nikomatsakisGuillaume Gomez-0/+3
rustc: Separately feature gate repr(i128) Brought up during the discussion of #35118, the support for this is still somewhat buggy and so stabilization likely wants to be considered independently of the type itself.
2017-09-09Stabilize drop_types_in_const.Eduard-Mihai Burtescu-3/+2
2017-09-05add feature gate doc_masked and testsQuietMisdreavus-0/+6
2017-09-01rustc: Separately feature gate repr(i128)Alex Crichton-0/+3
Brought up during the discussion of #35118, the support for this is still somewhat buggy and so stabilization likely wants to be considered independently of the type itself.
2017-09-01Fix arm visitorMatt Ickstadt-0/+1
2017-09-01Implement RFC 1925Matt Ickstadt-0/+11
2017-08-29Auto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakisbors-23/+19
feature error span on attribute for fn_must_use, SIMD/align reprs, macro reëxport There were several feature-gated attributes for which the feature-not-available error spans would point to the item annotated with the gated attribute, when it would make more sense for the span to point to the attribute itself: if the attribute is removed, the function/struct/_&c._ likely still makes sense and the program will compile. (Note that we decline to make the analogous change for the `main`, `start`, and `plugin_registrar` features, for in those cases it makes sense for the span to implicate the entire function, of which there is little hope of using without the gated attribute.) ![feature_attr_error_span](https://user-images.githubusercontent.com/1076988/29746531-fd700bfe-8a91-11e7-9c5b-6f5324083887.png)
2017-08-28feature error span on attr. for fn_must_use, SIMD/align, macro reëxportZack M. Davis-23/+19
There were several feature-gated attributes for which the feature-not-available error spans would point to the item annotated with the gated attribute, when it would make more sense for the span to point to the attribute itself: if the attribute is removed, the function/struct/&c. likely still makes sense and the program will compile. (Note that we decline to make the analogous change for the `main`, `start`, and `plugin_registrar` features, for in those cases it makes sense for the span to implicate the entire function, of which there is little hope of using without the gated attribute.)
2017-08-28Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-13/+70
2017-08-22fn_must_use soft feature-gate warning on methods too, not only functionsZack M. Davis-1/+11
This continues to be in the matter of #43302.
2017-08-22"soft" (warn instead of error) feature-gate for #[must_use] on functionsZack M. Davis-10/+50
Before `#[must_use]` for functions was implemented, a `#[must_use]` attribute on a function was a no-op. To avoid a breaking change in this behavior, we add an option for "this-and-such feature is experimental" feature-gate messages to be a mere warning rather than a compilation-halting failure (so old code that used to have a useless no-op `#[must_use]` attribute now warns rather than breaking). When we're on stable, we add a help note to clarify that the feature isn't "on." This is in support of #43302.
2017-08-22correct comment re feature-checking toolingZack M. Davis-2/+2
The featureck.py that this comment referred to was removed in 9dd3c54a (March 2016).
2017-08-22hard feature-gate for #[must_use] on functionsZack M. Davis-1/+8
We'll actually want a new "soft" warning-only gate to maintain backwards-compatibility, but it's cleaner to start out with the established, well-understood gate before implementing the alternative warn-only behavior in a later commit. This is in the matter of #43302.
2017-08-17Merge remote-tracking branch 'origin/master' into genAlex Crichton-3/+2
2017-08-16Stabilize rvalue promotion to 'static.Eduard-Mihai Burtescu-3/+2
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-2/+2
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+28
2017-08-13Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichtonbors-0/+13
Expose all OS-specific modules in libstd doc. 1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc. 2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness. 3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed. Fixes #24658 (Does _not_ fully implement #1998).
2017-08-12syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.Eduard-Mihai Burtescu-0/+15
2017-08-10Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-10Implemented #[doc(cfg(...))].kennytm-0/+13
This attribute has two effects: 1. Items with this attribute and their children will have the "This is supported on **** only" message attached in the documentation. 2. The items' doc tests will be skipped if the configuration does not match.
2017-08-09extended information for E0554 feature attributes only work on nightliesZack M. Davis-1/+1
It's more pleasing to use the inner-attribute syntax (`#!` rather than `#`) in the error message, as that is how `feature` attributes in particular will be declared (as they apply to the entire crate).
2017-07-28Remove support for `gen arg`Alex Crichton-5/+0
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+14
2017-07-25Stabilize the `compile_error_macro` featureAlex Crichton-4/+2
Stabilizes: * `compile_error!` as a macro defined by rustc Closes #40872
2017-07-10Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakisbors-7/+6
Fix feature gate for `#[link_args(..)]` attribute Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute. See also #29596 and #43106
2017-07-10Fix feature gate for `#[link_args(..)]` attribute so that it will fireFelix S. Klock II-7/+6
regardless of context of attribute. Extend the gating test to include the attribute in "weird" places.
2017-07-06remove associated_consts feature gateSean McArthur-14/+3
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-7/+17
rustc: Implement the #[global_allocator] attribute This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-7/+17
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-0/+14
2017-06-29Give a tracking-issue number for unsized tuple coercion.Masaki Hara-1/+1
2017-06-29Move unsized_tuple_coercion behind a feature gate.Masaki Hara-0/+6
2017-06-26Implement `quote!` and other `proc_macro` API.Jeffrey Seyfried-11/+17
2017-06-24Add a feature gate for the `#[allow_fail]` attributePaul Woolcock-1/+8
2017-06-24add `allow_fail` test attributePaul Woolcock-0/+1
This change allows the user to add an `#[allow_fail]` attribute to tests that will cause the test to compile & run, but if the test fails it will not cause the entire test run to fail. The test output will show the failure, but in yellow instead of red, and also indicate that it was an allowed failure.
2017-06-19Add compile_error!Wesley Wiser-0/+4
Related to #40872
2017-06-15Remove struct_field_attributes feature gateWonwoo Choi-3/+2
2017-06-04Merge branch 'profiling' of github.com:whitequark/rust into profilingMarco Castelluccio-0/+11
2017-05-27Rollup merge of #42207 - Nashenas88:remove_fragment_info, r=eddybMark Simulacrum-6/+0
Remove all instances of fragment_infos and fragment sets Remove unused fragment structs. This was suggested by @eddyb in IRC: [botbot link](https://botbot.me/mozilla/rustc/2017-05-23/?msg=86016574&page=2).
2017-05-27Auto merge of #42162 - est31:closure-to-fn-coercion, r=aturonbors-6/+2
Stabilize non capturing closure to fn coercion Stabilisation PR for non capturing closure to fn coercion. closes #39817
2017-05-27Stabilize unions with `Copy` fields and no destructorVadim Petrochenkov-6/+0
2017-05-26Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakisbors-0/+7
add thiscall calling convention support This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-25Auto merge of #40847 - jseyfried:decl_macro, r=nrcbors-1/+9
Initial implementation of declarative macros 2.0 Implement declarative macros 2.0 (rust-lang/rfcs#1584) behind `#![feature(decl_macro)]`. Differences from `macro_rules!` include: - new syntax: `macro m(..) { .. }` instead of `macro_rules! m { (..) => { .. } }` - declarative macros are items: ```rust // crate A: pub mod foo { m!(); // use before definition; declaration order is irrelevant pub macro m() {} // `pub`, `pub(super)`, etc. work } fn main() { foo::m!(); // named like other items { use foo::m as n; n!(); } // imported like other items } pub use foo::m; // re-exported like other items // crate B: extern crate A; // no need for `#[macro_use]` A::foo::m!(); A::m!(); ``` - Racket-like hygiene for items, imports, methods, fields, type parameters, privacy, etc. - Intuitively, names in a macro definition are resolved in the macro definition's scope, not the scope in which the macro is used. - This [explaination](http://beautifulracket.com/explainer/hygiene.html) of hygiene for Racket applies here (except for the "Breaking Hygiene" section). I wrote a similar [explanation](https://github.com/jseyfried/rfcs/blob/hygiene/text/0000-hygiene.md) for Rust. - Generally speaking, if `fn f() { <body> }` resolves, `pub macro m() { <body> } ... m!()` also resolves, even if `m!()` is in a separate crate. - `::foo::bar` in a `macro` behaves like `$crate::foo::bar` in a `macro_rules!`, except it can access everything visible from the `macro` (thus more permissive). - See [`src/test/{run-pass, compile-fail}/hygiene`](https://github.com/rust-lang/rust/pull/40847/commits/afe7d89858fd72b983e24727d6f4058293153c19) for examples. Small example: ```rust mod foo { fn f() { println!("hello world"); } pub macro m() { f(); } } fn main() { foo::m!(); } ``` Limitations: - This does not address planned changes to matchers (`expr`,`ty`, etc.), c.f. #26361. - Lints (including stability and deprecation) and `unsafe` are not hygienic. - adding hygiene here will be mostly or entirely backwards compatible - Nested macro definitions (a `macro` inside another `macro`) don't always work correctly when invoked from external crates. - pending improvements in how we encode macro definitions in crate metadata - There is no way to "escape" hygiene without using a procedural macro. r? @nrc
2017-05-25Remove irrelevant tests and unused testing attributePaul Faria-6/+0
2017-05-25Stabilize non capturing closure to fn coercionest31-6/+2