Uh oh!
There was an error while loading. Please reload this page.
Implement #[rustc_default_body_unstable] - #96478
Conversation
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
4d1cee1 to
35a5566CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
May 22, 2022
☔ The latest upstream changes (presumably #97177) made this pull request unmergeable. Please resolve the merge conflicts. |
JohnCSimon
commented
Jun 20, 2022
Ping from triage: |
67118a6 to
6d86e5dComparebors
commented
Jul 14, 2022
☔ The latest upstream changes (presumably #95956) made this pull request unmergeable. Please resolve the merge conflicts. |
6d86e5d to
78eb420CompareThis attribute allows to mark default body of a trait function as
unstable. This means that implementing the trait without implementing
the function will require enabling unstable feature.
This is useful in conjunction with `#[rustc_must_implement_one_of]`,
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.78eb420 to
1e1d6feCompareAaron1011
commented
Jul 29, 2022
Sorry for the extreme delay - I had forgotten that this was assigned to me. This looks good to me overall - do we need lang-team signoff before adding this? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
WaffleLapkin
commented
Jul 31, 2022
I don't know, maybe 😄 |
Aaron1011
commented
Aug 5, 2022
r=me after confirmation from the libs teem that this is okay (or after an FCP if needed) |
Uh oh!
There was an error while loading. Please reload this page.
WaffleLapkin
commented
Aug 8, 2022
@Aaron1011 why libs team approval is needed? This PR doesn't change any library APIs after all. Quoting
|
Aaron1011
commented
Aug 8, 2022
@bors r+ |
bors
commented
Aug 8, 2022
Rollup of 7 pull requests Successful merges: - rust-lang#96478 (Implement `#[rustc_default_body_unstable]`) - rust-lang#99787 (Rustdoc-Json: Document HRTB's on DynTrait) - rust-lang#100181 (add method to get the mutability of an AllocId) - rust-lang#100221 (Don't document impossible to call default trait items on impls) - rust-lang#100228 (Don't ICE while suggesting updating item path.) - rust-lang#100301 (Avoid `&str` to `String` conversions) - rust-lang#100305 (Suggest adding an appropriate missing pattern excluding comments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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:
In order to implement
Traituser needs to eitheritem(even though it has a default implementation)#![feature(feat)]This is useful in conjunction with
#[rustc_must_implement_one_of], we may want to relax requirements for a trait, for example allowing implementing either ofPartialEq::{eq, ne}, but do so in a safe way — making implementation of onlyPartialEq::neunstable.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 😅