about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
AgeCommit message (Collapse)AuthorLines
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.
2019-03-29Whitelist `rustc_on_unimplemented` to avoid erroneous flagging as an unused ↵Felix S. Klock II-1/+1
attribute.
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-2/+6
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-22Hide "type ascription is experimental error" unless it's the only oneEsteban Küber-2/+6
In order to minimize the verbosity of common syntax errors that are parsed as type ascription, hide the feature gate error unless there are no other errors being emitted by the parser.
2019-03-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-8/+8
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-9/+9
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-17/+16
2019-03-16Rollup merge of #59169 - tmandry:allow-features-flag, r=cramertjkennytm-1/+10
Add `-Z allow_features=...` flag Adds a compiler option to allow only whitelisted features. For projects on nightly that want to prevent feature-creep (and maybe, someday, move off of nightly). Not being able to enforce this has been a problem on Fuchsia and at other big companies. This doesn't support filtering edition feature flags, but someone is welcome to add that if they need it.
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-1/+1
2019-03-14Add `-Z allow_features=...` flagTyler Mandry-1/+10
2019-03-09Rollup merge of #58762 - petrochenkov:unwind, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Mention `unwind(aborts)` in diagnostics for `#[unwind]` Simplify input validation for `#[unwind]`, add tests cc https://github.com/rust-lang/rust/issues/58760 r? @Mark-Simulacrum
2019-02-28Auto merge of #57760 - dlrobertson:varargs1, r=alexregbors-0/+12
Support defining C compatible variadic functions ## Summary Add support for defining C compatible variadic functions in unsafe rust with `extern "C"` according to [RFC 2137]. ## Details ### Parsing When parsing a user defined function that is `unsafe` and `extern "C"` allow variadic signatures and inject a "spoofed" `VaList` in the new functions signature. This allows the user to interact with the variadic arguments via a `VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for details). ### Codegen When running codegen for a variadic function, remove the "spoofed" `VaList` from the function signature and inject `va_start` when the arg local references are created for the function and `va_end` on return. ## TODO - [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen - [x] Properly inject `va_end` - It seems like it should be possible to inject `va_end` on the `TerminatorKind::Return`. I just need to figure out how to get the `LocalRef` here. - [x] Properly call Rust defined C variadic functions in Rust - The spoofed `VaList` causes problems here. Related to: #44930 r? @ghost [RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md
2019-02-27Add c_variadic language feature itemDan Robertson-0/+12
2019-02-27Rollup merge of #58761 - Mark-Simulacrum:add-feature-gate-unwind, r=CentrilMazdak Farrokhzad-2/+2
Add tracking issue for the unwind attribute cc https://github.com/rust-lang/rust/issues/58760
2019-02-27Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkorMazdak Farrokhzad-1/+1
Deny `async fn` in 2015 edition This commit prevents code using `async fn` from being compiled in Rust 2015 edition. Compiling code of the form: ```rust async fn foo() {} ``` Will now result in the error: ``` error[E0670]: `async fn` is not permitted in the 2015 edition --> async.rs:1:1 | 1 | async fn foo() {} | ^^^^^ error: aborting due to error For more information about an error, try `rustc --explain E0670`. ``` This resolves #58652 and also resolves #53714. r? @varkor
2019-02-27Mention `unwind(aborts)` in diagnostics for `#[unwind]`Vadim Petrochenkov-1/+1
Simplify input validation for `#[unwind]`, add tests
2019-02-26Add tracking issue for the unwind attribute.Mark Rousskov-2/+2
2019-02-25Stabilize `unrestricted_attribute_tokens`Vadim Petrochenkov-11/+7
2019-02-24Deny `async fn` in 2015 editionNathan Corbyn-1/+1
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
2019-02-23Correct error messagegnzlbg-1/+1
2019-02-23Implement ffi_returns_twice attributegnzlbg-0/+8
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-1/+1
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkovMazdak Farrokhzad-3/+9
allow shorthand syntax for deprecation reason Fixes #48271. Created based on discussion in #56896.
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-4/+3
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-13Cleanup importsTaiki Endo-1/+1
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-11Consistent attribute argument suggestionOliver Scherer-1/+1
2019-02-11Ease the transition to requiring features by just warning if there's no ↵Oliver Scherer-1/+2
feature list while we could make this change (it's all unstable after all), there are crates.io crates that use the feature and that the compiler depends upon. We can instead roll out this feature while still supporting the old way.
2019-02-11Require a list of features to allow in `allow_internal_unstable`Oliver Scherer-11/+13
2019-02-10rustc: doc commentsAlexander Regueiro-4/+3
2019-02-07Add const_generics feature flagvarkor-2/+13
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07Auto merge of #57998 - niklasf:align-enum, r=nagisabors-0/+14
Allow #[repr(align(x))] on enums (#57996) Tracking issue: #57996 Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999. It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs). cc @bitshifter
2019-02-07libsyntax => 2018Taiki Endo-13/+15
2019-02-05allow shorthand syntax for deprecation reasonAndy Russell-3/+9
2019-02-02fix stabilization order of uniform_paths.Mazdak Farrokhzad-2/+2
2019-01-30Add MOVBE featureJethro Beekman-0/+1
2019-01-30Allow #[repr(align(x))] on enums (#57996)Niklas Fiekas-0/+14
2019-01-26Rollup merge of #57407 - mehcode:stabilize-extern-crate-self, r=CentrilMazdak Farrokhzad-3/+2
Stabilize extern_crate_self Fixes #56409
2019-01-26Auto merge of #55641 - nagisa:optimize-attr, r=pnkfelixbors-0/+9
Implement optimize(size) and optimize(speed) attributes This PR implements both `optimize(size)` and `optimize(speed)` attributes. While the functionality itself works fine now, this PR is not yet complete: the code might be messy in places and, most importantly, the compiletest must be improved with functionality to run tests with custom optimization levels. Otherwise the new attribute cannot be tested properly. Oh, and not all of the RFC is implemented – attribute propagation is not implemented for example. # TODO * [x] Improve compiletest so that tests can be written; * [x] Assign a proper error number (E9999 currently, no idea how to allocate a number properly); * [ ] Perhaps reduce the duplication in LLVM attribute assignment code…
2019-01-25Resolve breakageSimonas Kazlauskas-1/+1
2019-01-25distinguish "no data" from "heterogeneous" for ABI purposesNiko Matsakis-0/+7
Also, add a testing infrastructure and tests that lets us dump layout.
2019-01-24Implement optimize(size) and optimize(speed)Simonas Kazlauskas-0/+9
2019-01-24Remove quote_*! macros and associated APIsMark Simulacrum-1/+1
2019-01-16Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakisbors-143/+242
Implement basic input validation for built-in attributes Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax"). For some subset of attributes (found by crater run), errors are lowered to deprecation warnings. NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-14stabilize extern_crate_selfRyan Leckey-3/+2
2019-01-14Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkovMazdak Farrokhzad-24/+5
Unaccept `extern_in_paths` Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac. Closes https://github.com/rust-lang/rust/issues/55600 r? @petrochenkov
2019-01-14Stabilize `cfg_target_vendor`, #29718Jethro Beekman-4/+2
2019-01-13remove extern_in_paths.Mazdak Farrokhzad-24/+5
2019-01-13Address review commentsVadim Petrochenkov-4/+11
2019-01-13Implement basic input validation for built-in attributesVadim Petrochenkov-143/+235