diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-08-09 17:34:50 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-09 17:34:50 +0530 |
| commit | 1dc485891479f5cbe07b6b87ae227fd54e5d3805 (patch) | |
| tree | 3af0068d2f6632e5cb4de349daf1be4a0cd527a4 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 5af97e8b0b9649ed14b0b4528a610ff841b6365e (diff) | |
| parent | 95bf0fb917577c61e4a9d41d837e6fa132515b3d (diff) | |
| download | rust-1dc485891479f5cbe07b6b87ae227fd54e5d3805.tar.gz rust-1dc485891479f5cbe07b6b87ae227fd54e5d3805.zip | |
Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011
Implement `#[rustc_default_body_unstable]`
This PR implements a new stability attribute — `#[rustc_default_body_unstable]`.
`#[rustc_default_body_unstable]` controls the stability of default bodies in traits.
For example:
```rust
pub trait Trait {
#[rustc_default_body_unstable(feature = "feat", isssue = "none")]
fn item() {}
}
```
In order to implement `Trait` user needs to either
- implement `item` (even though it has a default implementation)
- enable `#![feature(feat)]`
This is useful in conjunction with [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/pull/92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable.
r? `@Aaron1011`
cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`)
P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
