about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
2017-01-15Mark the pushpop_unsafe feature as "removed"est31-3/+1
This marks the pushpop_unsafe feature as removed inside the feature_gate. It was added in commit 1829fa5199bae5a192c771807c532badce14be37 and then removed again in commit d399098fd82e0bf3ed61bbbbcdbb0b6adfa4c808 . Seems that the second commit forgot to mark it as removed in feature_gate.rs. This enables us to remove another element from the whitelist of non gate tested unstable lang features (issue #39059).
2017-01-15Remove the safe_suggestion featureest31-3/+0
This removes the safe_suggestion feature from feature_gate.rs. It was added in commit 164f0105bb65f31b89e5fb7f368c9e6f5833a3f8 and then removed again in commit c11fe553df269d6f47b4c48f5c47c08efdd373dc . As the removal was in the same PR #38099 as the addition, we don't move it to the "removed" section. Removes an element from the whitelist of non gate tested unstable lang features (issue #39059).
2017-01-12Auto merge of #38814 - Ralith:cfg-fields, r=jseyfriedbors-0/+3
syntax: enable attributes and cfg on struct fields This enables conditional compilation of field initializers in a struct literal, simplifying construction of structs whose fields are themselves conditionally present. For example, the intializer for the constant in the following becomes legal, and has the intuitive effect: ```rust struct Foo { #[cfg(unix)] bar: (), } const FOO: Foo = Foo { #[cfg(unix)] bar: (), }; ``` It's not clear to me whether this calls for the full RFC process, but the implementation was simple enough that I figured I'd begin the conversation with code.
2017-01-11syntax: struct field attributes and cfgBenjamin Saunders-0/+3
2017-01-02rustc: Stabilize the `proc_macro` featureAlex Crichton-9/+3
This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the compiler to stabilize the "Macros 1.1" feature of the language. Many more details can be found on the tracking issue, #35900. Closes #35900
2016-12-30Further and hopefully final Windows fixesSimonas Kazlauskas-1/+8
2016-12-30Feature gate: 1.16.0 instead of 1.15.0est31-1/+1
2016-12-30Feature gate the 128 bit typesSimonas Kazlauskas-0/+15
Dangling a carrot in front of a donkey. This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-26PTX supportJorge Aparicio-1/+16
- `--emit=asm --target=nvptx64-nvidia-cuda` can be used to turn a crate into a PTX module (a `.s` file). - intrinsics like `__syncthreads` and `blockIdx.x` are exposed as `"platform-intrinsics"`. - "cabi" has been implemented for the nvptx and nvptx64 architectures. i.e. `extern "C"` works. - a new ABI, `"ptx-kernel"`. That can be used to generate "global" functions. Example: `extern "ptx-kernel" fn kernel() { .. }`. All other functions are "device" functions.
2016-12-20Create check_ref method to allow to check coercion with & typesGuillaume Gomez-6/+0
2016-12-20Fix coercion ICEGuillaume Gomez-1/+2
2016-12-20Add safe_suggestion attributeGuillaume Gomez-0/+9
2016-12-07Auto merge of #38191 - oli-obk:clippy_is_sad, r=eddybbors-14/+14
annotate stricter lifetimes on LateLintPass methods to allow them to forward to a Visitor this unblocks clippy (rustup blocked after #37918) clippy has lots of lints that internally call an `intravisit::Visitor`, but the current lifetimes on `LateLintPass` methods conflicted with the required lifetimes (there was no connection between the HIR elements and the `TyCtxt`) r? @Manishearth
2016-12-06Auto merge of #37973 - vadimcn:dllimport, r=alexcrichtonbors-7/+0
Implement RFC 1717 Implement the first two points from #37403. r? @alexcrichton
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-14/+14
to a Visitor
2016-12-04Auto merge of #38087 - jooert:remove_unmarked, r=petrochenkovbors-4/+3
Remove the `unmarked_api` feature Closes #37981.
2016-12-03Auto merge of #38079 - BurntSushi:attrtarget, r=alexcrichtonbors-0/+7
Add new #[target_feature = "..."] attribute. This commit adds a new attribute that instructs the compiler to emit target specific code for a single function. For example, the following function is permitted to use instructions that are part of SSE 4.2: #[target_feature = "+sse4.2"] fn foo() { ... } In particular, use of this attribute does not require setting the -C target-feature or -C target-cpu options on rustc. This attribute does not have any protections built into it. For example, nothing stops one from calling the above `foo` function on hosts without SSE 4.2 support. Doing so may result in a SIGILL. I've also expanded the x86 target feature whitelist.
2016-12-01Remove the "linked_from" feature.Vadim Chugunov-7/+0
2016-12-02limit the length of types in monomorphizationAriel Ben-Yehuda-0/+1
This adds the new insta-stable `#![type_size_limit]` crate attribute to control the limit, and is obviously a [breaking-change] fixable by that.
2016-11-30Remove the `unmarked_api` featureJohannes Oertel-4/+3
Closes #37981.
2016-11-29Add new #[target_feature = "..."] attribute.Andrew Gallant-0/+7
This commit adds a new attribute that instructs the compiler to emit target specific code for a single function. For example, the following function is permitted to use instructions that are part of SSE 4.2: #[target_feature = "+sse4.2"] fn foo() { ... } In particular, use of this attribute does not require setting the -C target-feature or -C target-cpu options on rustc. This attribute does not have any protections built into it. For example, nothing stops one from calling the above `foo` function on hosts without SSE 4.2 support. Doing so may result in a SIGILL. This commit also expands the target feature whitelist to include lzcnt, popcnt and sse4a. Namely, lzcnt and popcnt have their own CPUID bits, but were introduced with SSE4.
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-0/+7
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-21Auto merge of #37824 - jseyfried:symbols, r=eddybbors-13/+12
Clean up `ast::Attribute`, `ast::CrateConfig`, and string interning This PR - removes `ast::Attribute_` (changing `Attribute` from `Spanned<Attribute_>` to a struct), - moves a `MetaItem`'s name from the `MetaItemKind` variants to a field of `MetaItem`, - avoids needlessly wrapping `ast::MetaItem` with `P`, - moves string interning into `syntax::symbol` (`ast::Name` is a reexport of `symbol::Symbol` for now), - replaces `InternedString` with `Symbol` in the AST, HIR, and various other places, and - refactors `ast::CrateConfig` from a `Vec` to a `HashSet`. r? @eddyb
2016-11-21Stabilize RFC 1560.Jeffrey Seyfried-3/+1
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-7/+6
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-1/+1
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-2/+2
2016-11-20Move `MetaItemKind`'s `Name` to a field of `MetaItem`.Jeffrey Seyfried-3/+3
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-3/+3
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-1/+1
2016-11-17Add feature `use_extern_macros`.Jeffrey Seyfried-0/+2
2016-11-16rustc: Implement #[link(cfg(..))] and crt-staticAlex Crichton-0/+3
This commit is an implementation of [RFC 1721] which adds a new target feature to the compiler, `crt-static`, which can be used to select how the C runtime for a target is linked. Most targets dynamically linke the C runtime by default with the notable exception of some of the musl targets. [RFC 1721]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md This commit first adds the new target-feature, `crt-static`. If enabled, then the `cfg(target_feature = "crt-static")` will be available. Targets like musl will have this enabled by default. This feature can be controlled through the standard target-feature interface, `-C target-feature=+crt-static` or `-C target-feature=-crt-static`. Next this adds an gated and unstable `#[link(cfg(..))]` feature to enable the `crt-static` semantics we want with libc. The exact behavior of this attribute is a little squishy, but it's intended to be a forever-unstable implementation detail of the liblibc crate. Specifically the `#[link(cfg(..))]` annotation means that the `#[link]` directive is only active in a compilation unit if that `cfg` value is satisfied. For example when compiling an rlib, these directives are just encoded and ignored for dylibs, and all staticlibs are continued to be put into the rlib as usual. When placing that rlib into a staticlib, executable, or dylib, however, the `cfg` is evaluated *as if it were defined in the final artifact* and the library is decided to be linked or not. Essentially, what'll happen is: * On MSVC with `-C target-feature=-crt-static`, the `msvcrt.lib` library will be linked to. * On MSVC with `-C target-feature=+crt-static`, the `libcmt.lib` library will be linked to. * On musl with `-C target-feature=-crt-static`, the object files in liblibc.rlib are removed and `-lc` is passed instead. * On musl with `-C target-feature=+crt-static`, the object files in liblibc.rlib are used and `-lc` is not passed. This commit does **not** include an update to the liblibc module to implement these changes. I plan to do that just after the 1.14.0 beta release is cut to ensure we get ample time to test this feature. cc #37406
2016-11-10Rollup merge of #37661 - brson:qmarkstab, r=nikomatsakisEduard-Mihai Burtescu-1/+1
question_mark was stabilized in 1.13
2016-11-10syntax: don't fake a block around closures' bodies during parsing.Eduard Burtescu-5/+4
2016-11-09Rollup merge of #37614 - keeperofdakeys:proc_macro, r=jseyfriedEduard-Mihai Burtescu-4/+6
macros 1.1: Allow proc_macro functions to declare attributes to be mark as used This PR allows proc macro functions to declare attribute names that should be marked as used when attached to the deriving item. There are a few questions for this PR. - Currently this uses a separate attribute named `#[proc_macro_attributes(..)]`, is this the best choice? - In order to make this work, the `check_attribute` function had to be modified to not error on attributes marked as used. This is a pretty large change in semantics, is there a better way to do this? - I've got a few clones where I don't know if I need them (like turning `item` into a `TokenStream`), can these be avoided? - Is switching to `MultiItemDecorator` the right thing here? Also fixes https://github.com/rust-lang/rust/issues/37563.
2016-11-09question_mark was stabilized in 1.13Brian Anderson-1/+1
2016-11-08Partially stabilize RFC 1506 "Clarify relationships between ADTs"Vadim Petrochenkov-18/+17
2016-11-08Auto merge of #36843 - petrochenkov:dotstab, r=nikomatsakisbors-15/+2
Stabilize `..` in tuple (struct) patterns I'd like to nominate `..` in tuple and tuple struct patterns for stabilization. This feature is a relatively small extension to existing stable functionality and doesn't have known blockers. The feature first appeared in Rust 1.10 6 months ago. An example of use: https://github.com/rust-lang/rust/pull/36203 Closes https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis
2016-11-08Rename KNOWN_ATTRS to BUILT_ATTRS, and create KNOWN_ATTRSJosh Driver-4/+6
KNOWN_ATTRIBUTES should really be named BUILT_ATTRIBUTES, while KNOWN_ATTRIBUTES should be used to mark attributes as known, similar to USED_ATTRIBUTES.
2016-11-05Fix tests from the rollupAlex Crichton-1/+1
2016-11-05Merge branch 'selfgate' of https://github.com/petrochenkov/rust into rollupAlex Crichton-0/+3
2016-11-03Add feature gate for Self and associated types in struct expressions and ↵Vadim Petrochenkov-0/+3
patterns
2016-11-03Stabilize `..` in tuple (struct) patternsVadim Petrochenkov-15/+2
2016-10-31rustc: Add knowledge of Windows subsystems.Alex Crichton-0/+9
This commit is an implementation of [RFC 1665] which adds support for the `#![windows_subsystem]` attribute. This attribute allows specifying either the "windows" or "console" subsystems on Windows to the linker. [RFC 1665]: https://github.com/rust-lang/rfcs/blob/master/text/1665-windows-subsystem.md Previously all Rust executables were compiled as the "console" subsystem which meant that if you wanted a graphical application it would erroneously pop up a console whenever opened. When compiling an application, however, this is undesired behavior and the "windows" subsystem is used instead to have control over user interactions. This attribute is validated, but ignored on all non-Windows platforms. cc #37499
2016-10-27Auto merge of #37128 - nrc:depr-attr, r=@alexcrichtonbors-48/+116
Deprecate no_debug and custom_derive r? @nikomatsakis
2016-10-26Auto merge of #11994 - eddyb:struct-literal-field-shorthand, r=nrcbors-0/+11
Implement field shorthands in struct literal expressions. Implements #37340 in a straight-forward way: `Foo { x, y: f() }` parses as `Foo { x: x, y: f() }`. Because of the added `is_shorthand` to `ast::Field`, this is `[syntax-breaking]` (cc @Manishearth). * [x] Mark the fields as being a shorthand (the exact same way we do it in patterns), for pretty-printing. * [x] Gate the shorthand syntax with `#![feature(field_init_shorthand)]`. * [x] Don't parse numeric field as identifiers. * [x] Arbitrary field order tests.
2016-10-27review changesNick Cameron-8/+23
2016-10-27Implement field shorthands in struct literal expressions.Eduard Burtescu-0/+11
2016-10-27Deprecate custom_deriveNick Cameron-1/+6
Has a custom deprecation since deprecating features is not supported and is a pain to implement
2016-10-27deprecate no_debugNick Cameron-1/+1