about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
AgeCommit message (Collapse)AuthorLines
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
2023-12-31Update tracking issue of naked_functionsGary Guo-1/+1
The original tracking issue was superseded by a new one (constrainted naked functions) and therefore is closed.
2023-12-28Make feature `negative_bounds` internalLeón Orell Valerian Liehr-1/+1
2023-12-26Rollup merge of #119235 - Urgau:missing-feature-gate-sanitizer-cfi-cfgs, ↵Michael Goulet-0/+4
r=Nilstrieb Add missing feature gate for sanitizer CFI cfgs Found during the review of https://github.com/rust-lang/rust/pull/118494 in https://github.com/rust-lang/rust/pull/118494#discussion_r1416079288. cc `@rcvalle`
2023-12-23Auto merge of #119211 - rust-lang:pa-master-1.77, r=Mark-Simulacrumbors-7/+7
Bump stage0 to 1.76 beta r? `@Mark-Simulacrum`
2023-12-23Add missing CFI sanitizer cfgs feature gateUrgau-0/+4
2023-12-22update version placeholdersPietro Albini-7/+7
2023-12-19Desugar for await loopsEric Holk-1/+1
2023-12-19Plumb awaitness of for loopsEric Holk-0/+2
2023-12-10Remove edition umbrella features.Eric Huss-439/+433
2023-12-10Auto merge of #116952 - compiler-errors:lifetime_capture_rules_2024, r=TaKO8Kibors-0/+2
Implement 2024-edition lifetime capture rules RFC Implements rust-lang/rfcs#3498.
2023-12-06Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errorsbors-6/+0
Remove `#[rustc_host]`, use internal desugaring Also removed a way for users to explicitly specify the host param since that isn't particularly useful. This should eliminate any pain with encoding attributes across crates and etc. r? `@compiler-errors`
2023-12-05Add lifetime_capture_rules_2024Michael Goulet-0/+2
2023-12-05Rollup merge of #118123 - RalfJung:internal-lib-features, r=compiler-errorsMichael Goulet-6/+14
Add support for making lib features internal We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug. This extends that idea to lib features as well. It is an alternative to https://github.com/rust-lang/rust/pull/115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal. Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes https://github.com/rust-lang/rust/issues/115597.
2023-12-05Rollup merge of #118598 - Nadrieril:remove_precise_pointer_size_matching, ↵Matthias Krüger-2/+3
r=davidtwco Remove the `precise_pointer_size_matching` feature gate `usize` and `isize` are special for pattern matching because their range might depend on the platform. To make code portable across platforms, the following is never considered exhaustive: ```rust let x: usize = ...; match x { 0..=18446744073709551615 => {} } ``` Because of how rust handles constants, this also unfortunately counts `0..=usize::MAX` as non-exhaustive. The [`precise_pointer_size_matching`](https://github.com/rust-lang/rust/issues/56354) feature gate was introduced both for this convenience and for the possibility that the lang team could decide to allow the above. Since then, [half-open range patterns](https://github.com/rust-lang/rust/issues/67264) have been implemented, and since #116692 they correctly support `usize`/`isize`: ```rust match 0usize { // exhaustive! 0..5 => {} 5.. => {} } ``` I believe this subsumes all the use cases of the feature gate. Moreover no attempt has been made to stabilize it in the 5 years of its existence. I therefore propose we retire this feature gate. Closes https://github.com/rust-lang/rust/issues/56354
2023-12-05Remove `#[rustc_host]`, use internal desugaringDeadbeef-6/+0
2023-12-04Remove the `precise_pointer_size_matching` feature gateNadrieril-2/+3
2023-12-02Auto merge of #118470 - nnethercote:cleanup-error-handlers, r=compiler-errorsbors-1/+1
Cleanup error handlers Mostly by making function naming more consistent. More to do after this, but this is enough for one PR. r? compiler-errors
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-12-01Auto merge of #117472 - jmillikin:stable-c-str-literals, r=Nilstriebbors-2/+2
Stabilize C string literals RFC: https://rust-lang.github.io/rfcs/3348-c-str-literal.html Tracking issue: https://github.com/rust-lang/rust/issues/105723 Documentation PR (reference manual): https://github.com/rust-lang/reference/pull/1423 # Stabilization report Stabilizes C string and raw C string literals (`c"..."` and `cr#"..."#`), which are expressions of type [`&CStr`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html). Both new literals require Rust edition 2021 or later. ```rust const HELLO: &core::ffi::CStr = c"Hello, world!"; ``` C strings may contain any byte other than `NUL` (`b'\x00'`), and their in-memory representation is guaranteed to end with `NUL`. ## Implementation Originally implemented by PR https://github.com/rust-lang/rust/pull/108801, which was reverted due to unintentional changes to lexer behavior in Rust editions < 2021. The current implementation landed in PR https://github.com/rust-lang/rust/pull/113476, which restricts C string literals to Rust edition >= 2021. ## Resolutions to open questions from the RFC * Adding C character literals (`c'.'`) of type `c_char` is not part of this feature. * Support for `c"..."` literals does not prevent `c'.'` literals from being added in the future. * C string literals should not be blocked on making `&CStr` a thin pointer. * It's possible to declare constant expressions of type `&'static CStr` in stable Rust (as of v1.59), so C string literals are not adding additional coupling on the internal representation of `CStr`. * The unstable `concat_bytes!` macro should not accept `c"..."` literals. * C strings have two equally valid `&[u8]` representations (with or without terminal `NUL`), so allowing them to be used in `concat_bytes!` would be ambiguous. * Adding a type to represent C strings containing valid UTF-8 is not part of this feature. * Support for a hypothetical `&Utf8CStr` may be explored in the future, should such a type be added to Rust.