File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed
Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ pub fn derive_non_exhaustive(input: TokenStream) -> TokenStream {
3131 let name = & field. ident ;
3232 quote ! {
3333 match :: partialdebug:: specialization:: AsDebug :: as_debug( & self . #name) {
34- None => {
34+ :: core :: option :: Option :: None => {
3535 __exhaustive = false ;
3636 }
37- Some ( field) => {
37+ :: core :: option :: Option :: Some ( field) => {
3838 __s. field( stringify!( #name) , field) ;
3939 }
4040 }
@@ -195,8 +195,8 @@ fn gen_field_as_debug(
195195 . field(
196196 #name_arg
197197 match :: partialdebug:: specialization:: AsDebug :: as_debug( & #field_handle) {
198- None => & :: partialdebug:: Placeholder ( #placeholder_string) ,
199- Some ( __field) => __field,
198+ :: core :: option :: Option :: None => & :: partialdebug:: Placeholder ( #placeholder_string) ,
199+ :: core :: option :: Option :: Some ( __field) => __field,
200200 } ,
201201 )
202202 }
@@ -219,8 +219,8 @@ fn gen_field_as_debug(
219219 . field(
220220 #name_arg
221221 match :: partialdebug:: no_specialization:: DebugDetector :: <#field_type>:: as_debug( & #field_handle) {
222- None => & :: partialdebug:: Placeholder ( #placeholder_string) ,
223- Some ( __field) => __field,
222+ :: core :: option :: Option :: None => & :: partialdebug:: Placeholder ( #placeholder_string) ,
223+ :: core :: option :: Option :: Some ( __field) => __field,
224224 } ,
225225 )
226226 }
Original file line number Diff line number Diff line change 11#![ no_implicit_prelude]
22#![ no_std]
33#![ cfg_attr( feature = "unstable" , feature( debug_non_exhaustive) ) ]
4+ #![ allow( dead_code) ]
45
56use :: partialdebug;
67
7- // These are required for now
8- use :: core:: option:: Option :: * ;
9-
10- #[ cfg_attr(
11- feature = "unstable" ,
12- derive( partialdebug:: non_exhaustive:: PartialDebug )
13- ) ]
148#[ cfg( feature = "unstable" ) ]
9+ #[ derive( partialdebug:: non_exhaustive:: PartialDebug ) ]
1510struct NonExhaustive {
1611 field : usize ,
1712}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ mod partial {
2020 }
2121}
2222
23+ #[ allow( dead_code) ]
2324mod normal {
2425 #[ derive( Debug ) ]
2526 pub struct UnitStruct ;
You can’t perform that action at this time.
0 commit comments