-
Notifications
You must be signed in to change notification settings - Fork 61
Update Rust crate derive_more to v2 #8691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oxide-renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/derive_more-2.x
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+14
−9
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
6606684 to
2458ff9
Compare
2458ff9 to
b8fd6c7
Compare
dea1aa3 to
67d5c89
Compare
e2795c6 to
59cd850
Compare
aeb16ad to
5138dd4
Compare
175abf1 to
8c4f2e4
Compare
bc10ae8 to
cd2a808
Compare
d8bdee8 to
a95a579
Compare
a95a579 to
91b0c29
Compare
59572c2 to
c601d3e
Compare
c3d4344 to
69e618d
Compare
69e618d to
97bb512
Compare
97bb512 to
cdb61b7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.99.20->2.0.1Release Notes
JelteF/derive_more (derive_more)
v2.0.1Compare Source
Added
Playground will have all
derive_morefeatures available onceselectorscrate updates itsderive_moreversion.(#445)
v2.0.0Compare Source
Breaking changes
use derive_more::SomeTraitnow imports macro only. Importing macro withits trait along is possible now via
use derive_more::with_trait::SomeTrait.(#406)
#[display("...")]attribute on an enum now has defaulting behaviorinstead of replacing when no wrapping is possible (no
_variantplaceholder).(#395)
Fixed
Debugand
Displayexpansions.(#399)
unreachable_codewarnings on generated code when!(never type) is used.(#404)
TryFrom,TryIntoorFromStrwith an associated item called
ErrororErrrespectively.(#410)
#[display("...")]attribute on an enum being incorrectly treatedas transparent or wrapping.
(#395)
DebugandDisplayexpansions.(#431)
Debugexpansions.(#431)
#[display("...")]attribute on an enum not working transparentlyfor directly specified fields.
(#438)
DebugandDisplayexpansions.(#440)
v1.0.0Compare Source
More than 8 years after the first commit and almost 5 years after the 0.99.0
release,
derive_morehas finally reached its 1.0.0 release. This releasecontains a lot of changes (including some breaking ones) to make it easier to
use the derives and make it possible to extend them without having to break
backwards compatibility again. There are five major changes that I would like
to call out, but there are many more changes that are documented below:
Debugderive that can be used to easily customizeDebugformatting.
Displayderive, which allows you to do anything thatthiserrorprovides, but it worksfor any type not just errors. And by combining the
Displayderive with theErrorandFromderives, there shouldn't really be any need to usethiserroranymore (if you are missing a feature/behaviour fromthiserrorplease report an issue).
Errorwhen an error occurs instead of a
&'static str.use derive_more::SomeTraitthe actual trait is also importednot just the derive macro. This is especially useful for
ErrorandDisplayBreaking changes
stdfeature which should be disabled inno_stdenvironments.std, are now disabled by default. Thefullfeature can be used to get the old behavior of supporting all possible
derives.
TryFrom,Add,Sub,BitAnd,BitOr,BitXor,NotandNegderives now return a dedicated error type instead of a
&'static stronerror.
FromStrderive now uses a dedicatedFromStrErrorerror type insteadof generating unique one each time.
Displayderive (and otherfmt-like ones) now uses#[display("...", (<expr>),*)]syntax instead of#[display(fmt = "...", ("<expr>"),*)], and#[display(bound(<bound>))]instead of
#[display(bound = "<bound>")]. So without the double quotesaround the expressions and bounds.
DebugandDisplayderives (and otherfmt-like ones) now transparentlydelegate to the inner type when
#[display("...", (<expr>),*)]attribute istrivially substitutable with a transparent call.
(#322)
DebugCustomderive is renamed to justDebug(gated now under a separatedebugfeature), and its semantics were changed to be a superset ofstdvariantof
Debug.Fromderive doesn't deriveFrom<()>for enum variants without anyfields anymore. This feature was removed because it was considered useless in
practice.
Fromderive now uses#[from(<types>)]instead of#[from(types(<types>))]and ignores field type itself.
Intoderive now uses#[into(<types>)]instead of#[into(types(<types>))]and ignores field type itself.
Intoderive now generates separate impls for each field whenever the#[into(...)]attribute is applied to it. (#291)
Errorderive is updated with changes to theerror_generic_member_accessunstable feature for nightly users. (#200,
#294)
as_mutfeature is removed, and theAsMutderive is now gated by theas_reffeature. (#295)#[display("...")]attribute on an enum now requires the usageof
{_variant}to include the variant instead of including it at{}. Thereason is that
{}now references the first argument to the format string,just like in all other format strings. (#377)
Added
Displayderives. So now you can use:#[display(fmt = "Prefix: {field}")]instead of needing to use#[display(fmt = "Prefix: {}", field)]FromStrderive support for enums that contain variants without fields.If you pass the name of the variant to
from_strit will create the matchingvariant.
#[unwrap(owned, ref, ref_mut)]attribute for theUnwrapderive.By using them, it is possible to derive implementations for the reference types as well.
(#206)
TryUnwrapderive similar to theUnwrapderive. This one returns aResultand does not panic.(#206)
Debugderive with the same syntax asDisplayderives.(#279)
derive_more::derivemodule exporting only macros, without traits.(#290)
AsRef/AsMutderives.(#298)
TryFromderive for enums to convert from their discriminant.(#300)
#[inline]attributes toIsVariantandDebugimplementations.(#334
#[track_caller]toAdd,Mul,AddAssignandMulAssignderives(#378
Changed
ConstructorandIsVariantderives now generateconst fnfunctions.IsVariantare now marked#[must_use].(#350)
UnwrapandIsVariantderives now generate doc comments.#[automatically_derived]is now emitted from all macro expansions. Thisshould prevent code style linters from attempting to modify the generated
code.
syn2.0.Errorderive now works in nightlyno_stdenvironmentsFixed
HashSetin all derives, this is needed for rust analyzerto work correctly.
ProviderAPI for backtraces inErrorderive.Errorderive not working withconstgenerics.Box<dyn Error + Send + 'static>IntoIteratorimpls for generic structs.(#284)
Displayderive.(#297)
corecrate.(#327)
IsVariantderive.{field:p}do the expected thing in format strings forDisplayandDebug. Also document weirdness aroundPointerformatting when usingexpressions, due to field variables being references.
(#381)
Configuration
📅 Schedule: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles.
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.