Skip to content

Commit 166df01

Browse files
committed
update to synstructure 0.13.1 and fix tests
Some tests were broken by a rustc changes. Upgrading to synstructure 0.13.1 fixes that but breaks the tests a different way. So we upgrade to synstructure 0.13.1 and also change the expectations to match what it does.
1 parent 369f750 commit 166df01

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

custom_debug_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ edition = "2021"
1212
proc-macro = true
1313

1414
[dependencies]
15-
synstructure = "0.13.0"
15+
synstructure = "0.13.1"
1616
proc-macro2 = "1.0.76"
1717
syn = "2.0.48"
1818
quote = "1.0.35"

custom_debug_derive/src/tests.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ fn test_default_struct() {
1313
}
1414

1515
expands to {
16-
#[allow(non_upper_case_globals)]
17-
const _DERIVE_core_fmt_Debug_FOR_Point: () = {
16+
const _: () = {
1817
impl ::core::fmt::Debug for Point {
1918
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
2019
match self {
@@ -44,8 +43,7 @@ fn test_format() {
4443
}
4544

4645
expands to {
47-
#[allow(non_upper_case_globals)]
48-
const _DERIVE_core_fmt_Debug_FOR_Point: () = {
46+
const _: () = {
4947
impl ::core::fmt::Debug for Point {
5048
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
5149
match self {
@@ -77,8 +75,7 @@ fn test_with() {
7775
}
7876

7977
expands to {
80-
#[allow(non_upper_case_globals)]
81-
const _DERIVE_core_fmt_Debug_FOR_Point: () = {
78+
const _: () = {
8279
impl ::core::fmt::Debug for Point {
8380
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
8481
match self {
@@ -127,8 +124,7 @@ fn test_skip() {
127124
}
128125

129126
expands to {
130-
#[allow(non_upper_case_globals)]
131-
const _DERIVE_core_fmt_Debug_FOR_Point: () = {
127+
const _: () = {
132128
impl ::core::fmt::Debug for Point {
133129
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
134130
match self {
@@ -161,8 +157,7 @@ fn test_conditional_skip() {
161157
}
162158

163159
expands to {
164-
#[allow(non_upper_case_globals)]
165-
const _DERIVE_core_fmt_Debug_FOR_Point: () = {
160+
const _: () = {
166161
impl ::core::fmt::Debug for Point {
167162
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
168163
match self {
@@ -198,8 +193,7 @@ fn test_enum() {
198193
}
199194

200195
expands to {
201-
#[allow(non_upper_case_globals)]
202-
const _DERIVE_core_fmt_Debug_FOR_Foo: () = {
196+
const _: () = {
203197
impl ::core::fmt::Debug for Foo {
204198
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
205199
match self {
@@ -256,8 +250,7 @@ fn test_bounds_on_skipped() {
256250
}
257251

258252
expands to {
259-
#[allow(non_upper_case_globals)]
260-
const _DERIVE_core_fmt_Debug_FOR_WantDebug: () = {
253+
const _: () = {
261254
impl<T> ::core::fmt::Debug for WantDebug<T>
262255
where
263256
TemplatedType<T>: ::core::fmt::Debug
@@ -301,8 +294,7 @@ fn test_bounds_on_fields_only() {
301294
}
302295

303296
expands to {
304-
#[allow(non_upper_case_globals)]
305-
const _DERIVE_core_fmt_Debug_FOR_WantDebug: () = {
297+
const _: () = {
306298
impl<T> ::core::fmt::Debug for WantDebug<T>
307299
where
308300
TemplatedType<T>: ::core::fmt::Debug,

0 commit comments

Comments
 (0)