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

Commit a3d2d7c

Browse files
Update structs test
1 parent e8a468c commit a3d2d7c

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

tests/cases/structs/new.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ pub struct Ghi {
2626
pub struct Hij {
2727
field: u8,
2828
}
29+
30+
pub struct Iij {
31+
pub field1: u8,
32+
pub field2: u8,
33+
}

tests/cases/structs/old.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ pub struct Ghi {
2424
}
2525

2626
pub struct Hij(u8);
27+
28+
pub struct Iij {
29+
field: u16,
30+
}

tests/cases/structs/stdout

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,29 @@ warning: tuple struct with no public fields changed to a regular struct (breakin
7979
28 | | }
8080
| |_^
8181

82-
error: aborting due to 4 previous errors; 2 warnings emitted
82+
warning: technically breaking changes in `Iij`
83+
--> structs/new.rs:30:1
84+
|
85+
30 | / pub struct Iij {
86+
31 | | pub field1: u8,
87+
32 | | pub field2: u8,
88+
33 | | }
89+
| |_^
90+
|
91+
note: private field removed from struct with private fields (non-breaking)
92+
--> structs/old.rs:29:5
93+
|
94+
29 | field: u16,
95+
| ^^^^^^^^^^
96+
note: public field added to struct with private fields (technically breaking)
97+
--> structs/new.rs:31:5
98+
|
99+
31 | pub field1: u8,
100+
| ^^^^^^^^^^^^^^
101+
note: public field added to struct with private fields (technically breaking)
102+
--> structs/new.rs:32:5
103+
|
104+
32 | pub field2: u8,
105+
| ^^^^^^^^^^^^^^
83106

107+
error: aborting due to 4 previous errors; 3 warnings emitted

0 commit comments

Comments
 (0)