about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2019-06-16Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkovbors-11/+3
Stabilize underscore_const_names in 1.37.0 You are now permitted to write: ```rust const _: $type_expression = $term_expression; ``` That is, we change the [grammar of items](https://github.com/rust-lang-nursery/wg-grammar/blob/9d1984d7ae8d6576f943566539a31a5800644c57/grammar/item.lyg#L3-L42), as written in [the *`.lyg`* notation](https://github.com/rust-lang/gll/tree/263bf161dad903e67aa65fc591ced3cab18afa2a#grammar), from: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IDENT ":" ty:Type "=" value:Expr ";" } | ... ; ``` into: ```java Item = attrs:OuterAttr* vis:Vis? kind:ItemKind; ItemKind = | ... | Const:{ "const" name:IdentOrUnderscore ":" ty:Type "=" value:Expr ";" } | ... ; IdentOrUnderscore = | Named:IDENT | NoName:"_" ; ``` r? @petrochenkov
2019-06-15cleanup some new active feature gates.Mazdak Farrokhzad-3/+2
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-0/+15
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-10Implement RFC 2645 (transparent enums and unions)Michael Bradshaw-0/+6
Tracking issue: #60405
2019-06-10Stabilize underscore_const_names.Mazdak Farrokhzad-11/+3
2019-06-09Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisabors-14/+3
Stabilize #![feature(repr_align_enum)] in Rust 1.37.0 On an `enum` item, you may now write: ```rust #[repr(align(X))] enum Foo { // ... } ``` This has equivalent effects to first defining: ```rust #[repr(align(X))] struct AlignX<T>(T); ``` and then using `AlignX<Foo>` in `Foo`'s stead. r? @nagisa
2019-06-09Allow attributes in formal function parametersCaio-0/+15
2019-06-08Introduce `#[rustc_dummy]` attribute and use it in testsVadim Petrochenkov-6/+9
Unlike other built-in attributes, this attribute accepts any input
2019-06-08Turn `#[allocator]` into a built-in attribute and rename it to ↵Vadim Petrochenkov-0/+5
`#[rustc_allocator]`
2019-06-07Auto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obkbors-0/+4
Make tuple constructors real const fns Mir construction special cases `Ctor(...)` to be lowered as `Ctor { 0: ... }`, which means this doesn't come up much in practice, but it seems inconsistent not to allow this. r? @oli-obk
2019-06-06Make constructors actually be const functionsMatthew Jasper-0/+4
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-3/+5
2019-06-05Added feature gate.Alexander Regueiro-12/+30
2019-05-27Stabilize repr_align_enum in 1.37.0.Mazdak Farrokhzad-14/+3
2019-05-25Reword malformed attribute input diagnosticsEsteban Küber-9/+41
- Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser
2019-05-24Remove `ObsoleteInPlace`varkor-3/+0
2019-05-23Auto merge of #60740 - petrochenkov:kw, r=nnethercotebors-2/+2
Simplify use of keyword symbols They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
2019-05-22Restore the old behavior of the rustdoc keyword check + Fix rebaseVadim Petrochenkov-2/+2
2019-05-22Allow null-pointer-optimized enums in FFI if their underlying representation ↵Michael Bradshaw-0/+7
is FFI safe This allows types like Option<NonZeroU8> to be used in FFI without triggering the improper_ctypes lint. This works by changing the is_repr_nullable_ptr function to consider an enum E to be FFI-safe if: - E has no explicit #[repr(...)]. - It only has two variants. - One of those variants is empty (meaning it has no fields). - The other variant has only one field. - That field is one of the following: - &T - &mut T - extern "C" fn - core::num::NonZero* - core::ptr::NonNull<T> - #[repr(transparent)] struct wrapper around one of the types in this list. - The size of E and its field are both known and are both the same size (implying E is participating in the nonnull optimization).
2019-05-14Fix incremental compilation of cdylib emitting spurious unused_attributes lintOliver Scherer-1/+1
2019-05-13add impl_trait_in_bindings to INCOMPLETE_FEATURESPulkit Goyal-0/+1
impl_trait_in_bindings is not yet complete and can lead to compiler crashes. Fixes #60764.
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-3/+3
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-9/+9
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-95/+96
2019-05-13Rename `syntax::symbol::symbols` as `syntax::symbol::sym`.Nicholas Nethercote-132/+132
Because it's going to be used a lot.
2019-05-07Auto merge of #60586 - cramertj:await, r=oli-obkbors-0/+18
Implement built-in await syntax Adds support for .await under the existing async_await feature gate. Moves macro-like await! syntax to the await_macro feature gate. Removes support for `await` as a non-keyword under the `async_await` feature. This new syntax is not final, but is the consensus solution proposed by the lang team, as explained in https://boats.gitlab.io/blog/post/await-decision/ Fix https://github.com/rust-lang/rust/issues/51719 Fix https://github.com/rust-lang/rust/issues/51751 Fix https://github.com/rust-lang/rust/issues/60016
2019-05-07Implement built-in await syntaxTaylor Cramer-0/+18
Adds support for .await under the existing async_await feature gate. Moves macro-like await! syntax to the await_macro feature gate. Removes support for `await` as a non-keyword under the `async_await` feature.
2019-05-04Rename 'no tracking issue START' to fit better with tidy.Mazdak Farrokhzad-8/+8
2019-05-04Enforce sorting of accepted and removed features.Mazdak Farrokhzad-8/+31
2019-05-02Group and sort feature_gate.rsAlexey Shmalko-11/+22
2019-04-30Rollup merge of #60362 - Centril:cleanup-declare-features-active, r=oli-obkMazdak Farrokhzad-183/+252
Cleanup 'active' declare_features! with uniform style + sorting. r? @oli-obk (added the FIXME you wanted) cc https://github.com/rust-lang/rust/pull/60354 cc https://github.com/rust-lang/rust/issues/60361
2019-04-30Rollup merge of #60354 - Centril:cleanup-declare-features-accepted, r=oli-obkMazdak Farrokhzad-56/+73
Cleanup declare_features! for 'accepted' with a uniform style + sort them r? @oli-obk cc https://github.com/rust-lang/rust/pull/60362 cc https://github.com/rust-lang/rust/issues/60361
2019-04-30Cleanup 'active' declare_features! with uniform style + sorting.Mazdak Farrokhzad-183/+252
2019-04-28Cleanup declare_features! for 'accepted' with a uniform style + sort them.Mazdak Farrokhzad-56/+73
2019-04-28Float 'incomplete_features' out to a const for visibility.Mazdak Farrokhzad-6/+9
2019-04-26Rollup merge of #60289 - tmandry:allow-features-include-std, r=cramertjMazdak Farrokhzad-17/+17
Make `-Z allow-features` work for stdlib features r? @cramertj
2019-04-25Make `-Z allow-features` work for stdlib featuresTyler Mandry-17/+17
2019-04-25Add feature-gate for f16c target featuregnzlbg-0/+1
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-3/+1
This also fully stabilizes two-phase borrows on all editions
2019-04-20Check async in trait methodsvarkor-0/+3
2019-04-20Fix additional variadic typosvarkor-1/+1
2019-04-20Fix typo in variadic C function warningvarkor-1/+1
2019-04-20Feature gate async fn methodsvarkor-19/+13
2019-04-17whitelist rtm x86 cpu featuretyler-0/+1
2019-04-15Preallocate BUILTIN_ATTRIBUTES symbols and use a hash map instead of loopingJohn Kåre Alsaker-392/+492
2019-04-15Make check_name genericJohn Kåre Alsaker-12/+12
2019-04-15Use a proc macro to declare preallocated symbolsJohn Kåre Alsaker-14/+14
2019-04-11Reword tracking issue noteEsteban Küber-2/+5
2019-04-10Tweak unstable diagnostic outputEsteban Küber-23/+41
2019-03-29Whitelist rustc_layout_scalar_valid_range_{start,end} so incr comp does not ↵Felix S. Klock II-0/+14
flag them as unused.