about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
AgeCommit message (Collapse)AuthorLines
2024-03-03Add new `pattern_complexity` attribute to add possibility to limit and check ↵Guillaume Gomez-0/+6
recursion in pattern matching
2024-02-29Forbid implementing `Freeze` even if the trait is stabilizedOli Scherer-0/+2
2024-02-29Rollup merge of #121740 - surechen:change_attribute_to_local_20240228, r=lcnrJacob Pratt-18/+45
Changing some attributes to only_local. Modified according to https://github.com/rust-lang/compiler-team/issues/505. r? ``@lcnr``
2024-02-28Changing some attributes to only_local.surechen-18/+45
Modified according to https://github.com/rust-lang/compiler-team/issues/505.
2024-02-27Stabilize the `#[diagnostic]` namespace and ↵Georg Semmler-2/+2
`#[diagnostic::on_unimplemented]` attribute This PR stabilizes the `#[diagnostic]` attribute namespace and a minimal option of the `#[diagnostic::on_unimplemented]` attribute. The `#[diagnostic]` attribute namespace is meant to provide a home for attributes that allow users to influence error messages emitted by the compiler. The compiler is not guaranteed to use any of this hints, however it should accept any (non-)existing attribute in this namespace and potentially emit lint-warnings for unused attributes and options. This is meant to allow discarding certain attributes/options in the future to allow fundamental changes to the compiler without the need to keep then non-meaningful options working. The `#[diagnostic::on_unimplemented]` attribute is allowed to appear on a trait definition. This allows crate authors to hint the compiler to emit a specific error message if a certain trait is not implemented. For the `#[diagnostic::on_unimplemented]` attribute the following options are implemented: * `message` which provides the text for the top level error message * `label` which provides the text for the label shown inline in the broken code in the error message * `note` which provides additional notes. The `note` option can appear several times, which results in several note messages being emitted. If any of the other options appears several times the first occurrence of the relevant option specifies the actually used value. Any other occurrence generates an lint warning. For any other non-existing option a lint-warning is generated. All three options accept a text as argument. This text is allowed to contain format parameters referring to generic argument or `Self` by name via the `{Self}` or `{NameOfGenericArgument}` syntax. For any non-existing argument a lint warning is generated. Tracking issue: #111996
2024-02-27Changing some attributes to only_local.surechen-22/+41
Modified according to https://github.com/rust-lang/compiler-team/issues/505. By running test cases, I found that modifying the attribute's only_local tag sometimes causes some unintuitive error reports, so I tend to split it into multiple PRs and edit a small number of attributes each time to prevent too many changes at once. Prevent possible subsequent difficulties in locating problems.
2024-02-26Auto merge of #121516 - RalfJung:platform-intrinsics-begone, r=oli-obkbors-2/+3
remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics `@Amanieu` `@workingjubilee` I don't think there is any reason these need to be "special"? The [original RFC](https://rust-lang.github.io/rfcs/1199-simd-infrastructure.html) indicated eventually making them stable, but I think that is no longer the plan, so seems to me like we can clean this up a bit. Blocked on https://github.com/rust-lang/stdarch/pull/1538, https://github.com/rust-lang/rust/pull/121542.
2024-02-26Rollup merge of #121493 - surechen:edit_attribute_only_local, r=lcnrMatthias Krüger-18/+44
By changing some attributes to only_local, reducing encoding attributes in the crate metadate. Thank you. This is part of changing attributes to only_local. I hope get your opinion whether I should split into multiple PRs, or submit in one. According to [try to not rely on attributes from extern crates](https://github.com/rust-lang/compiler-team/issues/505) and lcnr's guidance.
2024-02-25Rollup merge of #119590 - ChrisDenton:cfg-target-abi, r=NilstriebMatthias Krüger-3/+2
Stabilize `cfg_target_abi` This stabilizes the `cfg` option called `target_abi`: ```rust #[cfg(target_abi = "eabihf")] ``` Tracking issue: #80970 fixes #78791 resolves #80970
2024-02-25remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsicsRalf Jung-2/+3
2024-02-25Auto merge of #121114 - Nilstrieb:no-inline!, r=saethlinbors-0/+4
Add `#[rustc_no_mir_inline]` for standard library UB checks should help with #121110 and also with #120848 Because the MIR inliner cannot know whether the checks are enabled or not, so inlining is an unnecessary compile time pessimization when debug assertions are disabled. LLVM knows whether they are enabled or not, so it can optimize accordingly without wasting time. r? `@saethlin`
2024-02-24Stabilize `cfg_target_abi`Chris Denton-3/+2
2024-02-24Add `#[rustc_no_mir_inline]` for standard library UB checksNilstrieb-0/+4
Co-authored-by: Ben Kimock <kimockb@gmail.com>
2024-02-24Add asm label support to AST and HIRGary Guo-0/+2
2024-02-23Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errorsMatthias Krüger-1/+1
mark `min_exhaustive_patterns` as complete This is step 1 and 2 of my [proposal](https://github.com/rust-lang/rust/issues/119612#issuecomment-1918097361) to move `min_exhaustive_patterns` forward. The vast majority of in-tree use cases of `exhaustive_patterns` are covered by `min_exhaustive_patterns`. There are a few cases that still require `exhaustive_patterns` in tests and they're all behind references. r? ``@ghost``
2024-02-23By changing some attributes to only_local, reducing encoding attributes in ↵surechen-18/+44
the crate metadate. Thank you. This is part of changing attributes to only_local. I hope get your opinion whether I should split into multiple PRs, or submit in one. According to [try to not rely on attributes from extern crates](https://github.com/rust-lang/compiler-team/issues/505) and lcnr's guidance.
2024-02-20Stabilize `LazyCell` and `LazyLock` (`lazy_cell`)Peter Jaszkowiak-1/+0
2024-05-22Auto merge of #125326 - ↵bors-6/+0
weiznich:move/do_not_recommend_to_diganostic_namespace, r=compiler-errors Move `#[do_not_recommend]` to the `#[diagnostic]` namespace This commit moves the `#[do_not_recommend]` attribute to the `#[diagnostic]` namespace. It still requires `#![feature(do_not_recommend)]` to work. r? `@compiler-errors`
2024-05-21Move `#[do_not_recommend]` to the `#[diagnostic]` namespaceGeorg Semmler-6/+0
This commit moves the `#[do_not_recommend]` attribute to the `#[diagnostic]` namespace. It still requires `#![feature(do_not_recommend)]` to work.
2024-05-20Implement BOXED_SLICE_INTO_ITERMichael Goulet-4/+5
2024-05-20Rollup merge of #125314 - jdonszelmann:global-registration-feature-gate, ↵Matthias Krüger-0/+2
r=pnkfelix Add an experimental feature gate for global registration See #125119 for the tracking issue.
2024-05-20address nitFelix S Klock II-1/+1
2024-05-14create a feature gatejdonszelmann-0/+2
2024-05-13Add expr_2021 nonterminal and feature flagEric Holk-0/+2
This commit adds a new nonterminal `expr_2021` in macro patterns, and `expr_fragment_specifier_2024` feature flag. For now, `expr` and `expr_2021` are treated the same, but in future PRs we will update `expr` to match to new grammar. Co-authored-by: Vincezo Palazzo <vincenzopalazzodev@gmail.com>
2024-02-16Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkinbors-0/+4
Implement intrinsics with fallback bodies fixes #93145 (though we can port many more intrinsics) cc #63585 The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for * codegen_ssa (so llvm and gcc) * codegen_cranelift other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body). cc `@scottmcm` `@WaffleLapkin` ### todo * [ ] miri support * [x] default intrinsic name to name of function instead of requiring it to be specified in attribute * [x] make sure that the bodies are always available (must be collected for metadata)
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-1/+1
2024-02-15Use generic `NonZero` internally.Markus Reiter-8/+9
2024-02-13Unmark the feature gate as incompleteNadrieril-1/+1
2024-02-12Rollup merge of #120965 - ChrisDenton:sahf, r=michaelwoeristerMatthias Krüger-0/+2
Add lahfsahf and prfchw target feature This adds target features for LAHF/SAHF and PrefetchW. These came up. along with the existing CMPXCHG16b. as [baseline features](https://download.microsoft.com/download/c/1/5/c150e1ca-4a55-4a7e-94c5-bfc8c2e785c5/Windows%2010%20Minimum%20Hardware%20Requirements.pdf) required for x86_64 Windows 10+.
2024-02-12Add lahfsahf and prfchw target featureChris Denton-0/+2
2024-02-12Implement intrinsics with fallback bodiesOli Scherer-0/+4
2024-02-12Tweak delayed bug mentions.Nicholas Nethercote-1/+1
Now that we have both `delayed_bug` and `span_delayed_bug`, it makes sense to use the generic term "delayed bug" more.
2024-02-10unstably allow constants to refer to statics and read from immutable staticsRalf Jung-0/+2
2024-02-09Auto merge of #120676 - Mark-Simulacrum:bootstrap-bump, r=clubby789bors-6/+6
Bump bootstrap compiler to just-built 1.77 beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-2/+0
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-08Bump version placeholdersMark Rousskov-6/+6
2024-02-06Rollup merge of #120502 - clubby789:remove-ffi-returns-twice, r=compiler-errorsMatthias Krüger-5/+3
Remove `ffi_returns_twice` feature The [tracking issue](https://github.com/rust-lang/rust/issues/58314) and [RFC](https://github.com/rust-lang/rfcs/pull/2633) have been closed for a couple of years. There is also an attribute gate in R-A which should be removed if this lands.
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-02-01`#![feature(inline_const_pat)]` is no longer incompleteMatthew Jasper-1/+1
2024-01-30Remove `ffi_returns_twice` featureclubby789-5/+3
2024-01-30Remove the `abi_amdgpu_kernel` featureclubby789-2/+2
2024-01-24Add feature gateNadrieril-0/+3
2024-01-22Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin"Oli Scherer-3/+3
This reverts commit 6d2b84b3ed7848fd91b8d6151d4451b3103ed816, reversing changes made to 73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf.
2024-01-19Split remaining offset_of features into new tracking issuesGeorge Bateman-2/+2
2024-01-19Stabilize simple offset_ofGeorge Bateman-0/+2
2024-01-17Improved collapse_debuginfo attribute, added command-line flag (no|external|yes)Andrew Zhogin-1/+1
2024-01-12Rollup merge of #119866 - smoelius:patch-2, r=compiler-errorsMatthias Krüger-1/+1
Convert `effects` description to doc comment So that it is visible here: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_feature/unstable/struct.Features.html#structfield.effects r? `@fee1-dead`
2024-01-11Set `c_str_literals` stabilization version back to `CURRENT_RUSTC_VERSION`Eduardo Sánchez Muñoz-1/+1
`c_str_literals`'s stabilization has been delayed to 1.77 (https://github.com/rust-lang/rust/pull/119528).
2024-01-11Convert `effects` description to doc commentSamuel Moelius-1/+1
So that it is visible here: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_feature/unstable/struct.Features.html#structfield.effects
2024-01-05Rollup merge of #119354 - fmease:negative_bounds-fixes, r=compiler-errorsMatthias Krüger-1/+1
Make `negative_bounds` internal & fix some of its issues r? compiler-errors