about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
AgeCommit message (Collapse)AuthorLines
2023-02-10[link] enable packed bundled lib in non stable casesDaniil Belov-0/+2
2023-02-01Stabilize `#![feature(target_feature_11)]`Léo Lanteri Thauvin-2/+2
2023-02-01Stabilize cmpxchg16b_target_featureNugine-1/+2
2023-01-31Auto merge of #107297 - Mark-Simulacrum:bump-bootstrap, r=pietroalbinibors-4/+4
Bump bootstrap compiler to 1.68 This also changes our stage0.json to include the rustc component for the rustfmt pinned nightly toolchain, which is currently necessary due to rustfmt dynamically linking to that toolchain's librustc_driver and libstd. r? `@pietroalbini`
2023-01-28Reintroduce multiple_supertrait_upcastable lintGary Guo-0/+2
2023-01-25Set version placeholders to 1.68Mark Rousskov-4/+4
2023-01-25Rollup merge of #106767 - chbaker0:disable-unstable-features, r=Mark-SimulacrumDylan DPC-1/+2
Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0 Two locations check whether this build-time environment variable is defined. Allowing it to be explicitly disabled with a "0" value is useful, especially for integrating with external build systems.
2023-01-13Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obkbors-1/+3
Const closures cc https://github.com/rust-lang/rust/issues/106003
2023-01-13Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplettYuki Okushi-2/+2
Stabilize `abi_efiapi` feature Tracking issue: https://github.com/rust-lang/rust/issues/65815 Closes #65815
2023-01-12Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0Collin Baker-1/+2
Two locations check whether this build-time environment variable is defined. Allowing it to be explicitly disabled with a "0" value is useful, especially for integrating with external build systems.
2023-01-11Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, ↵Michael Goulet-1/+2
r=petrochenkov Stabilize f16c_target_feature Resolves https://github.com/rust-lang/stdarch/issues/1234 Library PR for stabilizing corresponding intrinsics: https://github.com/rust-lang/stdarch/pull/1366 See also #44839 tracking issue for target_feature
2023-01-12gate const closuresDeadbeef-1/+3
2023-01-11Stabilize `abi_efiapi` featureNicholas Bishop-2/+2
Tracking issue: https://github.com/rust-lang/rust/issues/65815
2023-01-09[RFC 2397] Initial implementationCaio-0/+5
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-2/+2
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-01Use the correct tracking issue for `dyn_star`Léo Lanteri Thauvin-1/+1
2022-12-30Stabilize f16c_target_featureKathryn Long-1/+2
2022-12-29Revert "Implement allow-by-default multiple_supertrait_upcastable lint"David Tolnay-2/+0
This reverts commit 5e44a65517bfcccbe6624a70b54b9f192baa94f3.
2022-12-28update stabilization version numbersPietro Albini-4/+4
2022-12-28Rollup merge of #105484 - nbdd0121:upcast, r=compiler-errorsfee1-dead-0/+2
Implement allow-by-default `multiple_supertrait_upcastable` lint The lint detects when an object-safe trait has multiple supertraits. Enabled in libcore and liballoc as they are low-level enough that many embedded programs will use them. r? `@nikomatsakis`
2022-12-16Auto merge of #102318 - Amanieu:default_alloc_error_handler, r=oli-obkbors-2/+2
Stabilize default_alloc_error_handler Tracking issue: #66741 This turns `feature(default_alloc_error_handler)` on by default, which causes the compiler to automatically generate a default OOM handler which panics if `#[alloc_error_handler]` is not provided. The FCP completed over 2 years ago but the stabilization was blocked due to an issue with unwinding. This was fixed by #88098 so stabilization can be unblocked. Closes #66741
2022-12-10Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3Matthias Krüger-1/+1
Add LLVM KCFI support to the Rust compiler This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!
2022-12-09Implement allow-by-default multiple_supertrait_upcastable lintGary Guo-0/+2
2022-12-08Add LLVM KCFI support to the Rust compilerRamon de C Valle-1/+1
This commit adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2022-11-27Stabilize native library modifier `verbatim`Vadim Petrochenkov-2/+2
2022-11-21Auto merge of #103491 - cjgillot:self-rpit, r=oli-obkbors-0/+2
Support using `Self` or projections inside an RPIT/async fn I reuse the same idea as https://github.com/rust-lang/rust/pull/103449 to use variances to encode whether a lifetime parameter is captured by impl-trait. The current implementation of async and RPIT replace all lifetimes from the parent generics by `'static`. This PR changes the scheme ```rust impl<'a> Foo<'a> { fn foo<'b, T>() -> impl Into<Self> + 'b { ... } } opaque Foo::<'_a>::foo::<'_b, T>::opaque<'b>: Into<Foo<'_a>> + 'b; impl<'a> Foo<'a> { // OLD fn foo<'b, T>() -> Foo::<'static>::foo::<'static, T>::opaque::<'b> { ... } ^^^^^^^ the `Self` becomes `Foo<'static>` // NEW fn foo<'b, T>() -> Foo::<'a>::foo::<'b, T>::opaque::<'b> { ... } ^^ the `Self` stays `Foo<'a>` } ``` There is the same issue with projections. In the example, substitute `Self` by `<T as Trait<'b>>::Assoc` in the sugared version, and `Foo<'_a>` by `<T as Trait<'_b>>::Assoc` in the desugared one. This allows to support `Self` in impl-trait, since we do not replace lifetimes by `'static` any more. The same trick allows to use projections like `T::Assoc` where `Self` is allowed. The feature is gated behind a `impl_trait_projections` feature gate. The implementation relies on 2 tweaking rules for opaques in 2 places: - we only relate substs that correspond to captured lifetimes during TypeRelation; - we only list captured lifetimes in choice region computation. For simplicity, I encoded the "capturedness" of lifetimes as a variance, `Bivariant` vs `Invariant` for unused vs captured lifetimes. The `variances_of` query used to ICE for opaques. Impl-trait that do not reference `Self` or projections will have their variances as: - `o` (invariant) for each parent type or const; - `*` (bivariant) for each parent lifetime --> will not participate in borrowck; - `o` (invariant) for each own lifetime. Impl-trait that does reference `Self` and/or projections will have some parent lifetimes marked as `o` (as the example above), and participate in type relation and borrowck. In the example above, `variances_of(opaque) = ['_a: o, '_b: *, T: o, 'b: o]`. r? types cc `@compiler-errors` , as you asked about the issue with `Self` and projections.
2022-11-18rename to `string_deref_patterns`Deadbeef-2/+2
2022-11-17Add feature gateDeadbeef-0/+2
2022-11-15Rollup merge of #104339 - compiler-errors:rustc_deny_explicit_impl, r=cjgillotMatthias Krüger-0/+4
Add `rustc_deny_explicit_impl` Also adjust `E0322` error message to be more general, since it's used for `DiscriminantKind` and `Pointee` as well. Also add `rustc_deny_explicit_impl` on the `Tuple` and `Destruct` marker traits.
2022-11-14Rollup merge of #104349 - rustaceanclub:master, r=oli-obkMatthias Krüger-1/+1
fix some typos in comments
2022-11-14Add rustc_deny_explicit_implMichael Goulet-0/+4
2022-11-14Auto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbinibors-5/+5
Bump bootstrap compiler to 1.66 This PR: - Bumps version placeholders to release - Bumps to latest beta - cfg-steps code r? `@pietroalbini`
2022-11-13fix some typos in commentscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-11-12Rollup merge of #104117 - crlf0710:update_feature_gate, r=jackh726Guillaume Gomez-3/+3
Mark `trait_upcasting` feature no longer incomplete. This marks the `trait_upcasting` feature no longer incomplete since #101336 has been settled for a little while. r? ``````@jackh726``````
2022-11-12Add tracking issue number.Camille GILLOT-1/+1
2022-11-12Make impl_trait_projections a feature gate.Camille GILLOT-0/+2
2022-11-11Mark `trait_upcasting` feature no longer incomplete.Charles Lew-3/+3
2022-11-08Add support for custom MIR parsingJakob Degen-0/+6
2022-11-06Bump version placeholders to releaseMark Rousskov-5/+5
2022-11-05Auto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obkbors-7/+3
Stabilize the `instruction_set` feature Closes https://github.com/rust-lang/rust/issues/74727 FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253 r? `@pnkfelix` and/or `@nikomatsakis` cc `@xd009642` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-11-03Stabilize default_alloc_error_handlerAmanieu d'Antras-2/+2
Closes #66741
2022-10-31Rewrite implementation of `#[alloc_error_handler]`Amanieu d'Antras-4/+0
The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`. The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic. This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called. This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-10-30Rollup merge of #97971 - Soveu:varargs, r=jackh726Michael Howell-0/+3
Enable varargs support for calling conventions other than C or cdecl This patch makes it possible to use varargs for calling conventions, which are either based on C (efiapi) or C is based on them (sysv64 and win64). Also pinging ``@phlopsi,`` because he noticed first this oversight when writing a library for UEFI.
2022-10-30Rollup merge of #93582 - WaffleLapkin:rpitirpit, r=compiler-errorsDylan DPC-0/+2
Allow `impl Fn() -> impl Trait` in return position _This was originally proposed as part of #93082 which was [closed](https://github.com/rust-lang/rust/pull/93082#issuecomment-1027225715) due to allowing `impl Fn() -> impl Trait` in argument position._ This allows writing the following function signatures: ```rust fn f0() -> impl Fn() -> impl Trait; fn f3() -> &'static dyn Fn() -> impl Trait; ``` These signatures were already allowed for common traits and associated types, there is no reason why `Fn*` traits should be special in this regard. `impl Trait` in both `f0` and `f3` means "new existential type", just like with `-> impl Iterator<Item = impl Trait>` and such. Arrow in `impl Fn() ->` is right-associative and binds from right to left, it's tested by [this test](https://github.com/WaffleLapkin/rust/blob/a819fecb8dea438fc70488ddec30a61e52942672/src/test/ui/impl-trait/impl_fn_associativity.rs). There even is a test that `f0` compiles: https://github.com/rust-lang/rust/blob/2f004d2d401682e553af3984ebd9a3976885e752/src/test/ui/impl-trait/nested_impl_trait.rs#L25-L28 But it was changed in [PR 48084 (lines)](https://github.com/rust-lang/rust/pull/48084/files#diff-ccecca938872d65ffe8cd1c3ef1956e309fac83bcda547d8b16b89257e53a437R37) to test the opposite, probably unintentionally given [PR 48084 (lines)](https://github.com/rust-lang/rust/pull/48084/files#diff-5a02f1ed43debed1fd24f7aad72490064f795b9420f15d847bac822aa4621a1cR476-R477). r? `@nikomatsakis` ---- This limitation is especially annoying with async code, since it forces one to write this: ```rust trait AsyncFn3<A, B, C>: Fn(A, B, C) -> <Self as AsyncFn3<A, B, C>>::Future { type Future: Future<Output = Self::Out>; type Out; } impl<A, B, C, Fut, F> AsyncFn3<A, B, C> for F where F: Fn(A, B, C) -> Fut, Fut: Future, { type Future = Fut; type Out = Fut::Output; } fn async_closure() -> impl AsyncFn3<i32, i32, i32, Out = u32> { |a, b, c| async move { (a + b + c) as u32 } } ``` Instead of: ```rust fn async_closure() -> impl Fn(i32, i32, i32) -> impl Future<Output = u32> { |a, b, c| async move { (a + b + c) as u32 } } ```
2022-10-26Rollup merge of #95710 - ↵Dylan DPC-2/+2
fee1-dead-contrib:stabilize_arbitrary_enum_discriminant, r=joshtriplett Stabilize arbitrary_enum_discriminant, take 2 Documentation has been updated in https://github.com/rust-lang/reference/pull/1055. cc #86860 for previous stabilization report. Not yet marks https://github.com/rust-lang/rust/issues/60553 as done: need documentation in the rust reference.
2022-10-25Feature gate `impl_trait_in_fn_trait_return`Maybe Waffle-0/+2
2022-10-24Rollup merge of #99939 - saethlin:pre-sort-tests, r=thomcc,jackh726Yuki Okushi-1/+1
Sort tests at compile time, not at startup Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately. (except for doctests, because there is no compile-time harness)
2022-10-23Enable varargs support for calling conventions other than C or cdeclSoveu-0/+3
This patch makes it possible to use varargs for calling conventions, which are either based on C (like efiapi) or C is based on them (for example sysv64 and win64).
2022-10-22Stabilize arbitrary_enum_discriminant, take 2Deadbeef-2/+2
2022-10-20Add code comments and documentationGuillaume Gomez-0/+2