about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-18/+20
2018-08-14syntax: add `uniform_paths` feature-gate.Eduard-Mihai Burtescu-0/+3
2018-08-11Feature gate arbitrary tokens in non-macro attributes with a separate gateVadim Petrochenkov-21/+25
Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`
2018-08-10Rollup merge of #53179 - gnzlbg:patch-3, r=alexcrichtonkennytm-0/+1
Whitelist wasm32 simd128 target feature r? @alexcrichton
2018-08-08Auto merge of #53053 - petrochenkov:custattr, r=alexcrichtonbors-51/+10
resolve: Support custom attributes when macro modularization is enabled Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute. Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`). Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it). The first two commits are preliminary cleanups/refactorings.
2018-08-08add wasm_target_feature feature gategnzlbg-0/+1
2018-08-07Auto merge of #51990 - oli-obk:unstable_union, r=nikomatsakisbors-0/+12
Place unions, pointer casts and pointer derefs behind extra feature gates To ensure we don't stabilize these things together with const fn stabilization (or any other stabilization) This PR moves union field accesses inside `const fn` behind a feature gate. It was possible without a feature gate before, but since `const fn` was behind a feature gate we can do this change. While "dereferencing raw pointers" and "casting raw pointers to usize" were hard errors before this PR, one could work around them by abusing unions: ```rust // deref union Foo<T> { x: &'static T, y: *const T, } const FOO: u32 = unsafe { *Foo { y: 42 as *const T }.x }; // as usize cast union Bar<T> { x: usize, y: *const T, } const BAR: usize = unsafe { Bar { y: &1u8 }.x }; ``` r? @eddyb cc @nikomatsakis
2018-08-07Also put comparing raw pointers behind a feature gateOliver Schneider-0/+3
2018-08-07Place unions, pointer casts and pointer derefs behind extra feature gatesOliver Schneider-0/+9
2018-08-07Rollup merge of #53135 - joshtriplett:remove-catch-from-2018-preview, ↵kennytm-1/+1
r=Mark-Simulacrum Rust 2018: Disable catch_expr, not targeted for 2018 edition Fixes #52604
2018-08-06Auto merge of #53016 - scottmcm:impl-header-lifetime-elision, r=nikomatsakisbors-1/+5
Extract impl_header_lifetime_elision out of in_band_lifetimes This way we can experiment with `impl Debug for &MyType` separately from `impl Debug for &'a MyType`. I can't say I know what the code in here is doing, so please let me know if there's a better way :slightly_smiling_face: I marked this as enabled in 2018 so that edition code continues to work without another flag. Actual feature PR https://github.com/rust-lang/rust/pull/49251; Tracking Issue https://github.com/rust-lang/rust/issues/15872; In-band lifetimes tracking issue https://github.com/rust-lang/rust/issues/44524. cc @aturon, per discussion on discord earlier cc @cramertj & @nikomatsakis, who actually wrote these features
2018-08-06Rust 2018: Disable catch_expr, not targeted for 2018 editionJosh Triplett-1/+1
Fixes #52604
2018-08-06Address review commentsVadim Petrochenkov-8/+0
Adjust a few fulldeps and pretty-printing tests Fix rebase
2018-08-06Enable macro modularization implicitly if one of "advanced" macro features ↵Vadim Petrochenkov-4/+8
is enabled Do not mark all builtin attributes as used when macro modularization is enabled
2018-08-06Support custom attributes when macro modularization is enabledVadim Petrochenkov-42/+5
2018-08-05Change feature edition error into a warningvarkor-1/+1
2018-08-05Add an error when declaring features that are stable in the current Rust editionvarkor-22/+38
2018-08-05Add special support for libcvarkor-1/+0
2018-08-05Convert unknown_features lint into an errorvarkor-1/+0
2018-08-05Add duplicity lint for lang featuresvarkor-9/+7
2018-08-04Remove in-band lifetimes from the 2018 editionScott McMurray-1/+1
As mentioned in the 2018-08-04 edition status update, these are postponed as lacking consensus to stabilize.
2018-08-03Extract impl_header_lifetime_elision out of in_band_lifetimesScott McMurray-0/+4
2018-08-02Auto merge of #52841 - petrochenkov:premacro, r=alexcrichtonbors-24/+14
resolve: Implement prelude search for macro paths, implement tool attributes When identifier is macro path is resolved in scopes (i.e. the first path segment - `foo` in `foo::mac!()` or `foo!()`), scopes are searched in the same order as for non-macro paths - items in modules, extern prelude, tool prelude (see later), standard library prelude, language prelude, but with some extra shadowing restrictions (names from globs and macro expansions cannot shadow names from outer scopes). See the comment in `fn resolve_lexical_macro_path_segment` for more details. "Tool prelude" currently contains two "tool modules" `rustfmt` and `clippy`, and is searched immediately after extern prelude. This makes the [possible long-term solution](https://github.com/rust-lang/rfcs/blob/master/text/2103-tool-attributes.md#long-term-solution) for tool attributes exactly equivalent to the existing extern prelude scheme, except that `--extern=my_crate` making crate names available in scope is replaced with something like `--tool=my_tool` making tool names available in scope. The `tool_attributes` feature is still unstable and `#![feature(tool_attributes)]` now implicitly enables `#![feature(use_extern_macros)]`. `use_extern_macros` is a prerequisite for `tool_attributes`, so their stabilization will happen in the same order. If `use_extern_macros` is not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway). Fixes https://github.com/rust-lang/rust/issues/52576 Fixes https://github.com/rust-lang/rust/issues/52512 Fixes https://github.com/rust-lang/rust/issues/51277 cc https://github.com/rust-lang/rust/issues/52269
2018-08-01resolve: Implement prelude search for macro pathsVadim Petrochenkov-24/+14
resolve/expansion: Implement tool attributes
2018-08-01Rollup merge of #52842 - toidiu:ak-commentUpdate, r=estebankPietro Albini-1/+1
update comment r? @joshtriplett Addressing comment: https://github.com/rust-lang/rust/pull/52761#pullrequestreview-141323066
2018-07-30Auto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obkbors-1/+1
Tweak the raw_identifiers lints in 2018 * Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-29update commenttoidiu-1/+1
2018-07-26feature gate for inferring 'static lifetimestoidiu-0/+9
2018-07-26Tweak the raw_identifiers lints in 2018Alex Crichton-1/+1
* Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-23Rollup merge of #52581 - petrochenkov:bmacrodoc, r=alexcrichtonkennytm-1/+2
Avoid using `#[macro_export]` for documenting builtin macros Use a special `rustc_*` attribute instead. cc https://github.com/rust-lang/rust/pull/52234
2018-07-22Auto merge of #52394 - estebank:println, r=oli-obkbors-0/+4
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
2018-07-21Gate `format_args_nll` behind feature flagEsteban Küber-0/+4
2018-07-21Avoid using `#[macro_export]` for documenting builtin macrosVadim Petrochenkov-1/+2
2018-07-20Auto merge of #52445 - alexcrichton:wasm-import-module, r=eddybbors-7/+0
rustc: Stabilize #[wasm_import_module] as #[link(...)] This commit stabilizes the `#[wasm_import_module]` attribute as `#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in the `#[link]` attribute is used to configured the module name that the imports are listed with. The WebAssembly specification indicates two utf-8 names are associated with all imported items, one for the module the item comes from and one for the item itself. The item itself is configurable in Rust via its identifier or `#[link_name = "..."]`, but the module name was previously not configurable and defaulted to `"env"`. This commit ensures that this is also configurable. Closes #52090
2018-07-19Auto merge of #52024 - oli-obk:existential_parse, r=nikomatsakisbors-0/+21
Implement existential types (not for associated types yet) r? @nikomatsakis cc @Centril @varkor @alexreg
2018-07-18rustc: Stabilize #[wasm_import_module] as #[link(...)]Alex Crichton-7/+0
This commit stabilizes the `#[wasm_import_module]` attribute as `#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in the `#[link]` attribute is used to configured the module name that the imports are listed with. The WebAssembly specification indicates two utf-8 names are associated with all imported items, one for the module the item comes from and one for the item itself. The item itself is configurable in Rust via its identifier or `#[link_name = "..."]`, but the module name was previously not configurable and defaulted to `"env"`. This commit ensures that this is also configurable. Closes #52090
2018-07-18Rollup merge of #52472 - alexcrichton:macros-edition-2018, r=petrochenkovkennytm-1/+1
rustc: Enable `use_extern_macros` in 2018 edition This was previously enabled via `proc_macro`, but since `proc_macro` is now stable this is no longer the case. Explicitly include it in the 2018 edition here.
2018-07-18Implement existential typesOliver Schneider-0/+21
2018-07-18Auto merge of #52353 - alexcrichton:wasm-custom-section, r=eddybbors-8/+0
rustc: Use link_section, not wasm_custom_section This commit transitions definitions of custom sections on the wasm target from the unstable `#[wasm_custom_section]` attribute to the already-stable-for-other-targets `#[link_section]` attribute. Mostly the same restrictions apply as before, except that this now applies only to statics. Closes #51088
2018-07-17rustc: Enable `use_extern_macros` in 2018 editionAlex Crichton-1/+1
This was previously enabled via `proc_macro`, but since `proc_macro` is now stable this is no longer the case. Explicitly include it in the 2018 edition here.
2018-07-16rustc: Use link_section, not wasm_custom_sectionAlex Crichton-8/+0
This commit transitions definitions of custom sections on the wasm target from the unstable `#[wasm_custom_section]` attribute to the already-stable-for-other-targets `#[link_section]` attribute. Mostly the same restrictions apply as before, except that this now applies only to statics. Closes #51088
2018-07-16rustc: Stabilize much of the `proc_macro` featureAlex Crichton-26/+11
This commit stabilizes some of the `proc_macro` language feature as well as a number of APIs in the `proc_macro` crate as [previously discussed][1]. This means that on stable Rust you can now define custom procedural macros which operate as attributes attached to items or `macro_rules!`-like bang-style invocations. This extends the suite of currently stable procedural macros, custom derives, with custom attributes and custom bang macros. Note though that despite the stabilization in this commit procedural macros are still not usable on stable Rust. To stabilize that we'll need to stabilize at least part of the `use_extern_macros` feature. Currently you can define a procedural macro attribute but you can't import it to call it! A summary of the changes made in this PR (as well as the various consequences) is: * The `proc_macro` language and library features are now stable. * Other APIs not stabilized in the `proc_macro` crate are now named under a different feature, such as `proc_macro_diagnostic` or `proc_macro_span`. * A few checks in resolution for `proc_macro` being enabled have switched over to `use_extern_macros` being enabled. This means that code using `#![feature(proc_macro)]` today will likely need to move to `#![feature(use_extern_macros)]`. It's intended that this PR, once landed, will be followed up with an attempt to stabilize a small slice of `use_extern_macros` just for procedural macros to make this feature 100% usable on stable. [1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-6/+8
2018-07-13Add the `amdgpu-kernel` ABI.Richard Diamond-0/+6
Technically, there are requirements imposed by the LLVM `AMDGPUTargetMachine` on functions with this ABI (eg, the return type must be void), but I'm unsure exactly where this should be enforced.
2018-07-09Implement #[alloc_error_handler]Simon Sapin-0/+8
This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the alloc crate without the std crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
2018-07-06Auto merge of #52018 - flip1995:rfc2103, r=oli-obkbors-0/+2
Implementation of tool lints. Tracking issue: #44690
2018-07-05rustc: Update tracking issue for wasm_import_moduleAlex Crichton-1/+1
It's now https://github.com/rust-lang/rust/issues/52090
2018-07-04Implementation of tool lintsflip1995-0/+2
2018-06-30Auto merge of #51806 - oli-obk:lowering_cleanups1, r=cramertjbors-1/+1
Lowering cleanups [1/N]
2018-06-28Rollup merge of #51799 - mark-i-m:lower_case_feature_gate, r=mark-i-mkennytm-4/+4
Lower case some feature gate error messages