summary refs log tree commit diff
path: root/compiler/rustc_feature/src
AgeCommit message (Collapse)AuthorLines
2024-08-15derive(SmartPointer): register helper attributesDing Xiang Fei-6/+0
(cherry picked from commit 5534cb0a4a3907db50956f7664ab2e5c3b2bc00a)
2024-07-21Update CURRENT_RUSTC_VERSIONMark Rousskov-9/+9
2024-07-14Rollup merge of #127630 - compiler-errors:type-ascription, r=chenyukangMatthias Krüger-2/+0
Remove lang feature for type ascription (since it's a lib feature now) It's not necessary since it's a library feature now, via the type ascription macro. We can't (and shouldn't) register it as a removed feature since I think that would give "this feature has been removed" errors even for people using the macro (well, I'm pretty sure, though I didn't check). r? `@Nilstrieb`
2024-07-14clarify the meaning of the version number for accepted/removed featuresRalf Jung-0/+14
2024-07-12Added the `xop` target feature and `xop_target_feature` gatesayantn-0/+2
2024-07-12Rollup merge of #126639 - sayantn:amx, r=AmanieuMatthias Krüger-0/+2
Add AMX target-features and `x86_amx_intrinsics` feature flag This is an effort towards #126622. This adds support for all 5 target-features for `AMX`, and introduces the feature flag `x86_amx_intrinsics`, which would gate these target-features and the yet-to-be-implemented amx intrinsics in stdarch.
2024-07-11Add the feature gate and target-featuressayantn-0/+2
2024-07-12Rollup merge of #127622 - compiler-errors:builtin-internal, r=lqdMatthias Krüger-2/+2
Mark `builtin_syntax` as internal Tracking issue literally says: > There will never be a general stabilization. cc #110680 `@est31`
2024-07-11Remove lang feature for type ascriptionMichael Goulet-2/+0
2024-07-11Mark builtin syntax as internalMichael Goulet-2/+2
2024-07-11Remove extern "wasm" ABINikita Popov-2/+3
Remove the unstable `extern "wasm"` ABI (`wasm_abi` feature tracked in #83788). As discussed in https://github.com/rust-lang/rust/pull/127513#issuecomment-2220410679 and following, this ABI is a failed experiment that did not end up being used for anything. Keeping support for this ABI in LLVM 19 would require us to switch wasm targets to the `experimental-mv` ABI, which we do not want to do. It should be noted that `Abi::Wasm` was internally used for two things: The `-Z wasm-c-abi=legacy` ABI that is still used by default on some wasm targets, and the `extern "wasm"` ABI. Despite both being `Abi::Wasm` internally, they were not the same. An explicit `extern "wasm"` additionally enabled the `+multivalue` feature. I've opted to remove `Abi::Wasm` in this patch entirely, instead of keeping it as an ABI with only internal usage. Both `-Z wasm-c-abi` variants are now treated as part of the normal C ABI, just with different different treatment in adjust_for_foreign_abi.
2024-07-09Auto merge of #127200 - fee1-dead-contrib:trait_def_const_trait, ↵bors-1/+1
r=compiler-errors Add `constness` to `TraitDef` Second attempt at fixing the regression @ https://github.com/rust-lang/rust/pull/120639#issuecomment-2198373716 r? project-const-traits
2024-07-05Auto merge of #127008 - Jules-Bertholet:tc-ergonomics, r=Nadrierilbors-0/+2
Match ergonomics 2024: Implement TC's match ergonomics proposal Under gate `ref_pat_eat_one_layer_2024_structural`. Enabling `ref_pat_eat_one_layer_2024` at the same time allows the union of what the individual gates allow. `@traviscross` r? `@Nadrieril` cc https://github.com/rust-lang/rust/issues/123076 `@rustbot` label A-edition-2024 A-patterns
2024-07-03Add `constness` to `TraitDef`Deadbeef-1/+1
2024-06-30add `rustc_dump_def_parents` attributeBoxy-0/+4
2024-06-30New features gates mustn't specify a version by handGuillaume Boisseau-1/+1
2024-06-28implement new effects desugaringDeadbeef-0/+4
2024-06-28Rollup merge of #124741 - nebulark:patchable-function-entries-pr, ↵Matthias Krüger-0/+9
r=estebank,workingjubilee patchable-function-entry: Add unstable compiler flag and attribute Tracking issue: #123115 Add the -Z patchable-function-entry compiler flag and the #[patchable_function_entry(prefix_nops = m, entry_nops = n)] attribute. Rebased and adjusted the canditate implementation to match changes in the RFC.
2024-06-27Implement TC's match ergonomics 2024 proposalJules Bertholet-0/+2
Under gate `ref_pat_eat_one_layer_2024_structural`. Enabling `ref_pat_eat_one_layer_2024` at the same time allows the union of what the individual gates allow.
2024-06-25Updated code for changes to RFC, added additional error handling, addedFlorian Schmiderer-7/+6
tests
2024-06-25Support `#[patchable_function_entries]`Matthew Maurer-0/+10
See [RFC](https://github.com/maurer/rust-rfcs/blob/patchable-function-entry/text/0000-patchable-function-entry.md) (yet to be numbered) TODO before submission: * Needs an RFC * Improve error reporting for malformed attributes
2024-06-25RFC 2383: Stabilize `lint_reasons` :tada:xFrednet-5/+5
2024-06-24Rollup merge of #126682 - Zalathar:coverage-attr, r=lcnrMichael Goulet-11/+15
coverage: Overhaul validation of the `#[coverage(..)]` attribute This PR makes sweeping changes to how the (currently-unstable) coverage attribute is validated: - Multiple coverage attributes on the same item/expression are now treated as an error. - The attribute must always be `#[coverage(off)]` or `#[coverage(on)]`, and the error messages for this are more consistent. - A trailing comma is still allowed after off/on, since that's part of the normal attribute syntax. - Some places that silently ignored a coverage attribute now produce an error instead. - These cases were all clearly bugs. - Some places that ignored a coverage attribute (with a warning) now produce an error instead. - These were originally added as lints, but I don't think it makes much sense to knowingly allow new attributes to be used in meaningless places. - Some of these errors might soon disappear, if it's easy to extend recursive coverage attributes to things like modules and impl blocks. --- One of the goals of this PR is to lay a more solid foundation for making the coverage attribute recursive, so that it applies to all nested functions/closures instead of just the one it is directly attached to. Fixes #126658. This PR incorporates #126659, which adds more tests for validation of the coverage attribute. `@rustbot` label +A-code-coverage
2024-06-24Rollup merge of #125575 - dingxiangfei2009:derive-smart-ptr, r=davidtwcoMichael Goulet-0/+8
SmartPointer derive-macro <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> --> Possibly replacing #123472 for continued upkeep of the proposal rust-lang/rfcs#3621 and implementation of the tracking issue #123430. cc `@Darksonn` `@wedsonaf`
2024-06-24coverage: Tighten validation of `#[coverage(off)]` and `#[coverage(on)]`Zalathar-10/+14
2024-06-24coverage: Forbid multiple `#[coverage(..)]` attributesZalathar-1/+1
It might make sense to allow this in the future, if we add values that aren't mutually exclusive, but for now having multiple coverage attributes on one item is useless.
2024-06-24Rollup merge of #126177 - carbotaniuman:unsafe_attr_errors, r=jieyouxuMatthias Krüger-5/+1
Add hard error and migration lint for unsafe attrs More implementation work for https://github.com/rust-lang/rust/issues/123757 This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
2024-06-23Add hard error and migration lint for unsafe attrscarbotaniuman-5/+1
2024-06-23Rollup merge of #126830 - RalfJung:unsized-fn-params, r=compiler-errorsMatthias Krüger-1/+1
make unsized_fn_params an internal feature As suggested [here](https://github.com/rust-lang/rust/pull/123894#issuecomment-2054043053). r? `@compiler-errors` Fixes https://github.com/rust-lang/rust/issues/123887 (kind of -- ICEs on internal features are considered acceptable so this issue is not-a-bug once this PR lands)
2024-06-24SmartPointer derive-macroXiangfei Ding-0/+8
Co-authored-by: Wedson Almeida Filho <walmeida@microsoft.com>
2024-06-22Rollup merge of #126552 - fee1-dead-contrib:rmfx, r=compiler-errorsMatthias Krüger-1/+1
Remove use of const traits (and `feature(effects)`) from stdlib The current uses are already unsound because they are using non-const impls in const contexts. We can reintroduce them by reverting the commit in this PR, after #120639 lands. Also, make `effects` an incomplete feature. cc `@rust-lang/project-const-traits` r? `@compiler-errors`
2024-06-22Make `effects` an incomplete featureDeadbeef-1/+1
2024-06-22make unsized_fn_params an internal featureRalf Jung-1/+1
2024-06-22Add `#[rustc_dump_{predicates,item_bounds}]`León Orell Valerian Liehr-0/+8
2024-06-20Auto merge of #116088 - nbdd0121:unwind, r=Amanieu,RalfJungbors-2/+2
Stabilise `c_unwind` Fix #74990 Fix #115285 (that's also where FCP is happening) Marking as draft PR for now due to `compiler_builtins` issues r? `@Amanieu`
2024-06-19Rollup merge of #126668 - fmease:rm-rustc_dump_program_clauses-attrs, ↵fee1-dead-8/+0
r=fee1-dead Remove now NOP attrs `#[rustc_dump{,_env}_program_clauses]` Likely NOP since #113303. r? `@fee1-dead`
2024-06-19Stabilise c_unwindGary Guo-2/+2
2024-06-19Remove now NOP attrs `#[rustc_dump{,_env}_program_clauses]`León Orell Valerian Liehr-8/+0
2024-06-19Rollup merge of #125293 - dingxiangfei2009:tail-expr-temp-lifetime, ↵许杰友 Jieyou Xu (Joe)-0/+2
r=estebank,davidtwco Place tail expression behind terminating scope This PR implements #123739 so that we can do further experiments in nightly. A little rewrite has been applied to `for await` lowering. It was previously `unsafe { Pin::unchecked_new(into_async_iter(..)) }`. Under the edition 2024 rule, however, `into_async_iter` gets dropped at the end of the `unsafe` block. This presumably the first Edition 2024 migration rule goes by hoisting `into_async_iter(..)` into `match` one level above, so it now looks like the following. ```rust match into_async_iter($iter_expr) { ref mut iter => match unsafe { Pin::unchecked_new(iter) } { ... } } ```
2024-06-17Delay a bug and mark precise_capturing as not incompleteMichael Goulet-1/+1
2024-06-17Rework precise capturing syntaxMichael Goulet-1/+1
2024-06-18tail expression behind terminating scopeDing Xiang Fei-0/+2
2024-06-14Auto merge of #118958 - c410-f3r:concat-again, r=petrochenkovbors-0/+2
Add a new concat metavar expr Revival of #111930 Giving it another try now that #117050 was merged. With the new rules, meta-variable expressions must be referenced with a dollar sign (`$`) and this can cause misunderstands with `$concat`. ```rust macro_rules! foo { ( $bar:ident ) => { const ${concat(VAR, bar)}: i32 = 1; }; } // Will produce `VARbar` instead of `VAR_123` foo!(_123); ``` In other words, forgetting the dollar symbol can produce undesired outputs. cc #29599 cc https://github.com/rust-lang/rust/issues/124225
2024-06-13Add a new concat metavar exprCaio-0/+2
2024-06-12Auto merge of #126273 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrumbors-7/+7
Bump stage0 to 1.80.0 r? `@Mark-Simulacrum`
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-1/+3
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-06-11replace version placeholderPietro Albini-7/+7
2024-06-08offset_of: allow (unstably) taking the offset of slice tail fieldsRalf Jung-0/+2
2024-06-06Fix orderingcarbotaniuman-2/+2
2024-06-06Remove extraneous attributecarbotaniuman-1/+0