Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit e8a468c

Browse files
Make rules around adding public fields in struct with private fields more flexible
1 parent 7dcda36 commit e8a468c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/changes.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ impl<'tcx> ChangeType<'tcx> {
370370
pub fn to_category(&self) -> ChangeCategory {
371371
// TODO: slightly messy and unreadable.
372372
match *self {
373+
//
374+
// Breaking
375+
//
373376
ItemMadePrivate |
374377
KindDifference |
375378
StaticMutabilityChanged { now_mut: false } |
@@ -381,8 +384,7 @@ impl<'tcx> ChangeType<'tcx> {
381384
TypeParameterRemoved { .. } |
382385
VariantAdded |
383386
VariantRemoved |
384-
VariantFieldAdded { public: true, .. } |
385-
VariantFieldAdded { public: false, total_public: true, .. } |
387+
VariantFieldAdded { total_public: true, .. } |
386388
VariantFieldRemoved { public: true, .. } |
387389
VariantFieldRemoved { public: false, is_enum: true, .. } |
388390
VariantStyleChanged { .. } |
@@ -397,12 +399,19 @@ impl<'tcx> ChangeType<'tcx> {
397399
TraitImplTightened |
398400
AssociatedItemRemoved |
399401
Unknown => Breaking,
402+
//
403+
// Technically breaking
404+
//
400405
MethodSelfChanged { now_self: true } |
401406
TraitItemAdded { .. } | // either defaulted or sealed
402407
BoundsLoosened { trait_def: false, .. } |
403408
TraitImplLoosened |
404409
AssociatedItemAdded |
410+
VariantFieldAdded { public: true, .. } |
405411
ItemMadePublic => TechnicallyBreaking,
412+
//
413+
// Non breaking
414+
//
406415
StaticMutabilityChanged { now_mut: true } |
407416
VarianceLoosened |
408417
TypeParameterAdded { defaulted: true } |

0 commit comments

Comments
 (0)