summary refs log tree commit diff
path: root/compiler/rustc_feature/src
AgeCommit message (Collapse)AuthorLines
2021-11-24Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelidGuillaume Gomez-4/+8
Create rustdoc_internals feature gate As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is https://github.com/rust-lang/rust/issues/90418. What do you think ``@rust-lang/rustdoc`` ?
2021-11-24Create rustdoc_internals feature gateGuillaume Gomez-4/+8
2021-11-23Rollup merge of #91140 - nbdd0121:const_typeck, r=oli-obkMatthias Krüger-1/+3
Split inline const to two feature gates and mark expression position inline const complete This PR splits inline const in pattern position into its own `#![feature(inline_const_pat)]` feature gate, and make the usage in expression position complete. I think I have resolved most outstanding issues related to `inline_const` with #89561 and other PRs. The only thing left that I am aware of is #90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in #89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another. ``@rustbot`` label: T-compiler F-inline_const
2021-11-22`#![feature(inline_const)]` is no longer incompleteGary Guo-1/+1
2021-11-22Split inline const to two feature gatesGary Guo-0/+2
2021-11-18Check for duplicate attributes.Eric Huss-155/+274
2021-11-18rustc: Remove `#[rustc_synthetic]`Vadim Petrochenkov-1/+0
This function parameter attribute was introduced in https://github.com/rust-lang/rust/pull/44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
2021-11-15Alphabetize language featuresJacob Pratt-795/+644
This should significantly reduce the frequency of merge conflicts.
2021-11-15Stabilize format_args_captureJosh Triplett-3/+2
Works as expected, and there are widespread reports of success with it, as well as interest in it.
2021-11-13Auto merge of #89551 - jhpratt:stabilize-const_raw_ptr_deref, r=oli-obkbors-3/+2
Stabilize `const_raw_ptr_deref` for `*const T` This stabilizes dereferencing immutable raw pointers in const contexts. It does not stabilize `*mut T` dereferencing. This is behind the same feature gate as mutable references. closes https://github.com/rust-lang/rust/issues/51911
2021-11-12rustc_feature: Convert `BuiltinAttribute` from tuple to a structVadim Petrochenkov-24/+41
2021-11-07Add features gates for experimental asm featuresAmanieu d'Antras-0/+9
2021-11-06Stabilize `const_raw_ptr_deref` for `*const T`Jacob Pratt-3/+2
This stabilizes dereferencing immutable raw pointers in const contexts. It does not stabilize `*mut T` dereferencing. This is placed behind the `const_raw_mut_ptr_deref` feature gate.
2021-11-02Rollup merge of #90502 - GuillaumeGomez:split-doc-cfg-feature, r=jyn514Matthias Krüger-0/+3
Split doc_cfg and doc_auto_cfg features Part of #90497. With this feature, `doc_cfg` won't pick up items automatically anymore. cc `@Mark-Simulacrum` r? `@jyn514`
2021-11-02Rollup merge of #90472 - joshtriplett:clarify-feature-acceptance, r=jyn514Matthias Krüger-1/+5
Clarify what to do with accepted feature gates The documentation only referenced `removed.rs`, but feature gates for accepted features move to `accepted.rs`.
2021-11-02Split doc_cfg and doc_auto_cfg featuresGuillaume Gomez-0/+3
2021-11-02Add link to documentation about feature gatesJosh Triplett-0/+3
2021-11-01Clarify what to do with accepted feature gatesJosh Triplett-1/+2
The documentation only referenced `removed.rs`, but feature gates for accepted features move to `accepted.rs`.
2021-10-30stabilize `relaxed_struct_unsize`lcnr-3/+2
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-3/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+3
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-23Auto merge of #90104 - spastorino:coherence-for-negative-trait, r=nikomatsakisbors-0/+1
Implement coherence checks for negative trait impls The main purpose of this PR is to be able to [move Error trait to core](https://github.com/rust-lang/project-error-handling/issues/3). This feature is necessary to handle the following from impl on box. ```rust impl From<&str> for Box<dyn Error> { ... } ``` Without having negative traits affect coherence moving the error trait into `core` and moving that `From` impl to `alloc` will cause the from impl to no longer compiler because of a potential future incompatibility. The compiler indicates that `&str` _could_ introduce an `Error` impl in the future, and thus prevents the `From` impl in `alloc` that would cause overlap with `From<E: Error> for Box<dyn Error>`. Adding `impl !Error for &str {}` with the negative trait coherence feature will disable this error by encoding a stability guarantee that `&str` will never implement `Error`, making the `From` impl compile. We would have this in `alloc`: ```rust impl From<&str> for Box<dyn Error> {} // A impl<E> From<E> for Box<dyn Error> where E: Error {} // B ``` and this in `core`: ```rust trait Error {} impl !Error for &str {} ``` r? `@nikomatsakis` This PR was built on top of `@yaahc` PR #85764. Language team proposal: to https://github.com/rust-lang/lang-team/issues/96
2021-10-23Rollup merge of #89730 - crlf0710:type_changing_feature, r=jackh726Matthias Krüger-0/+4
add feature flag for `type_changing_struct_update` This implements the PR0 part of the mentoring notes within #86618. overrides the previous inactive #86646 pr. r? ```@nikomatsakis```
2021-10-22Add rustc_strict_coherence attribute and use it to check overlapSantiago Pastorino-0/+1
2021-10-22add feature flag for `type_changing_struct_update`Charles Lew-0/+4
2021-10-15add a `rustc::query_stability` lintlcnr-0/+3
2021-10-14Revert "Stabilize `arbitrary_enum_discriminant`"Mark Rousskov-2/+3
This reverts commit 7a62f29f3171767090949778ce0f161e930706b9.
2021-10-14Auto merge of #89247 - fee1-dead:const-eval-select, r=oli-obkbors-0/+2
Add `const_eval_select` intrinsic Adds an intrinsic that calls a given function when evaluated at compiler time, but generates a call to another function when called at runtime. See https://github.com/rust-lang/const-eval/issues/7 for previous discussion. r? `@oli-obk.`
2021-10-12Add const_eval_select intrinsicDeadbeef-0/+2
2021-10-10Rollup merge of #89428 - DevinR528:reachable-featuregate, r=Nadrieril,camelidMatthias Krüger-0/+3
Feature gate the non_exhaustive_omitted_patterns lint Fixes https://github.com/rust-lang/rust/issues/89374 Add the machinery to gate the new `non_exhaustive_omitted_patterns` lint. relates to https://github.com/rust-lang/rust/pull/89105 and https://github.com/rust-lang/rust/pull/89423
2021-10-09Rollup merge of #89605 - camelid:fix-version, r=nagisaMatthias Krüger-1/+1
Fix stabilization version for `bindings_after_at` According to the release notes and its PR milestone, it was stabilized in 1.56.0.
2021-10-08Add feature gate to non_exhaustive_omitted_patterns lintDevin Ragotzy-0/+3
Actually add the feature to the lints ui test Add tracking issue to the feature declaration Rename feature gate to non_exhaustive_omitted_patterns_lint Add more omitted_patterns lint feature gate
2021-10-06Clean up code a bit:Guillaume Gomez-1/+1
* Remove "bool_to_options" feature * Update version for compiler feature * rustfmt
2021-10-06Fix stabilization version for `bindings_after_at`Noah Lev-1/+1
According to the release notes and its PR milestone, it was stabilized in 1.56.0.
2021-10-05Add test case for `doc_cfg_hide` feature gateJoshua Nelson-3/+3
2021-10-05Allow adding a set of cfg's to hide from being implicitly doc(cfg)'dWim Looman-0/+3
By adding #![doc(cfg_hide(foobar))] to the crate attributes the cfg #[cfg(foobar)] (and _only_ that _exact_ cfg) will not be implicitly treated as a doc(cfg) to render a message in the documentation.
2021-10-04Stabilize `const_panic`Jacob Pratt-3/+2
2021-09-24Stabilize `feature(macro_attributes_in_derive_output)`Vadim Petrochenkov-3/+2
2021-09-22Support `#[track_caller]` on closures and generatorsAaron Hill-0/+2
This PR allows applying a `#[track_caller]` attribute to a closure/generator expression. The attribute as interpreted as applying to the compiler-generated implementation of the corresponding trait method (`FnOnce::call_once`, `FnMut::call_mut`, `Fn::call`, or `Generator::resume`). This feature does not have its own feature gate - however, it requires `#![feature(stmt_expr_attributes)]` in order to actually apply an attribute to a closure or generator. This is implemented in the same way as for functions - an extra location argument is appended to the end of the ABI. For closures, this argument is *not* part of the 'tupled' argument storing the parameters - the final closure argument for `#[track_caller]` closures is no longer a tuple. For direct (monomorphized) calls, the necessary support was already implemented - we just needeed to adjust some assertions around checking the ABI and argument count to take closures into account. For calls through a trait object, more work was needed. When creating a `ReifyShim`, we need to create a shim for the trait method (e.g. `FnOnce::call_mut`) - unlike normal functions, closures are never invoked directly, and always go through a trait method. Additional handling was needed for `InstanceDef::ClosureOnceShim`. In order to pass location information throgh a direct (monomorphized) call to `FnOnce::call_once` on an `FnMut` closure, we need to make `ClosureOnceShim` aware of `#[tracked_caller]`. A new field `track_caller` is added to `ClosureOnceShim` - this is used by `InstanceDef::requires_caller` location, allowing codegen to pass through the extra location argument. Since `ClosureOnceShim.track_caller` is only used by codegen, we end up generating two identical MIR shims - one for `track_caller == true`, and one for `track_caller == false`. However, these two shims are used by the entire crate (i.e. it's two shims total, not two shims per unique closure), so this shouldn't a big deal.
2021-09-22Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obkbors-0/+8
Implement `#[must_not_suspend]` implements #83310 Some notes on the impl: 1. The code that searches for the attribute on the ADT is basically copied from the `must_use` lint. It's not shared, as the logic did diverge 2. The RFC does specify that the attribute can be placed on fn's (and fn-like objects), like `must_use`. I think this is a direct copy from the `must_use` reference definition. This implementation does NOT support this, as I felt that ADT's (+ `impl Trait` + `dyn Trait`) cover the usecase's people actually want on the RFC, and adding an imp for the fn call case would be significantly harder. The `must_use` impl can do a single check at fn call stmt time, but `must_not_suspend` would need to answer the question: "for some value X with type T, find any fn call that COULD have produced this value". That would require significant changes to `generator_interior.rs`, and I would need mentorship on that. `@eholk` and I are discussing it. 3. `@estebank` do you know a way I can make the user-provided `reason` note pop out? right now it seems quite hidden Also, I am not sure if we should run perf on this r? `@nikomatsakis`
2021-09-15Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwcoManish Goregaokar-3/+0
Revert anon union parsing Revert PR #84571 and #85515, which implemented anonymous union parsing in a manner that broke the context-sensitivity for the `union` keyword and thus broke stable Rust code. Fix #88583.
2021-09-13error formatting and fix buildGus Wynn-2/+2
2021-09-11must_not_suspend implGus Wynn-0/+8
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-5/+3
2021-09-09Revert "Implement Anonymous{Struct, Union} in the AST"Felix S. Klock II-3/+0
This reverts commit 059b68dd677808e14e560802d235ad40beeba71e. Note that this was manually adjusted to retain some of the refactoring introduced by commit 059b68dd677808e14e560802d235ad40beeba71e, so that it could likewise retain the correction introduced in commit 5b4bc05fa57be19bb5962f4b7c0f165e194e3151
2021-09-07Fix typo in `const_generics` replaced with `adt_const_params` noteMingwei Samuel-1/+1
2021-08-30Add let_else feature gateCameron Steffen-0/+3
2021-08-30`feature(const_param_types)` -> `feature(adt_const_params)`lcnr-3/+3
2021-08-30allow unordered const/ty params if any cg feature is activelcnr-1/+1
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-5/+8