rust/compiler/rustc_span/src
Dylan DPC 1dc4858914
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 😅
2022-08-09 17:34:50 +05:30
..
analyze_source_file remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
lev_distance Improve method name suggestions 2022-04-03 16:38:57 +01:00
source_map Add tests for FilePathMapping::to_embeddable_absolute_path(). 2022-05-18 11:42:43 +02:00
symbol Move the Lock into symbol::Interner 2021-09-15 18:46:45 +02:00
analyze_source_file.rs Fix some clippy lints 2020-12-03 17:08:19 -05:00
caching_source_map_view.rs Convert debug_assert to assert in CachingSourceMapView 2021-09-17 12:01:29 -05:00
def_id.rs Use delayed error handling for Encodable and Encoder infallible. 2022-06-08 07:01:26 +10:00
edition.rs Create 2024 edition 2022-04-02 02:45:49 -04:00
fatal_error.rs Make fatal DiagnosticBuilder yield never 2022-03-27 22:25:32 -07:00
hygiene.rs Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC 2022-07-14 11:00:30 +00:00
lev_distance.rs Improve method name suggestions 2022-04-03 16:38:57 +01:00
lib.rs Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC 2022-07-14 11:00:30 +00:00
profiling.rs extend EventArgRecorder into span-aware SpannedEventArgRecorder 2022-04-22 18:06:21 +02:00
source_map.rs Use line numbers relative to function in mir opt tests 2022-07-28 11:59:54 +02:00
span_encoding.rs Enable rustc_pass_by_value for Span 2022-02-25 08:00:53 -05:00
symbol.rs Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011 2022-08-09 17:34:50 +05:30
tests.rs Lazify SourceFile::lines. 2022-06-01 10:36:39 +10:00