@@ -693,17 +693,19 @@ macro_rules! assert_field_args {
693693 $field_name: expr $( , ) ?
694694 ) => {
695695 const _: ( ) = {
696- const BASE_NAME : & str = <$base_ty as $crate:: macros:: reflect:: BaseType <$scalar>>:: NAME ;
697- const IMPL_NAME : & str = <$impl_ty as $crate:: macros:: reflect:: BaseType <$scalar>>:: NAME ;
698- const ERR_PREFIX : & str = $crate:: const_concat!(
696+ const BASE_NAME : & :: core:: primitive:: str =
697+ <$base_ty as $crate:: macros:: reflect:: BaseType <$scalar>>:: NAME ;
698+ const IMPL_NAME : & :: core:: primitive:: str =
699+ <$impl_ty as $crate:: macros:: reflect:: BaseType <$scalar>>:: NAME ;
700+ const ERR_PREFIX : & :: core:: primitive:: str = $crate:: const_concat!(
699701 "Failed to implement interface `" ,
700702 BASE_NAME ,
701703 "` on `" ,
702704 IMPL_NAME ,
703705 "`: " ,
704706 ) ;
705707
706- const FIELD_NAME : & str = $field_name;
708+ const FIELD_NAME : & :: core :: primitive :: str = $field_name;
707709
708710 const BASE_ARGS : :: juniper:: macros:: reflect:: Arguments =
709711 <$base_ty as $crate:: macros:: reflect:: FieldMeta <
@@ -728,20 +730,20 @@ macro_rules! assert_field_args {
728730 TypeMismatch ,
729731 }
730732
731- const fn unwrap_error( v: :: std :: result:: Result <( ) , Error >) -> Error {
733+ const fn unwrap_error( v: :: core :: result:: Result <( ) , Error >) -> Error {
732734 match v {
733735 // Unfortunately we can't use `unreachable!()` here, as this
734736 // branch will be executed either way.
735- Ok ( ( ) ) => Error {
737+ :: core :: result :: Result :: Ok ( ( ) ) => Error {
736738 cause: Cause :: RequiredField ,
737739 base: ( "unreachable" , "unreachable" , 1 ) ,
738740 implementation: ( "unreachable" , "unreachable" , 1 ) ,
739741 } ,
740- Err ( err) => err,
742+ :: core :: result :: Result :: Err ( err) => err,
741743 }
742744 }
743745
744- const fn check( ) -> Result <( ) , Error > {
746+ const fn check( ) -> :: core :: result :: Result <( ) , Error > {
745747 let mut base_i = 0 ;
746748 while base_i < BASE_ARGS . len( ) {
747749 let ( base_name, base_type, base_wrap_val) = BASE_ARGS [ base_i] ;
@@ -800,18 +802,18 @@ macro_rules! assert_field_args {
800802 base_i += 1 ;
801803 }
802804 if !was_found {
803- return Err ( Error {
805+ return :: core :: result :: Result :: Err ( Error {
804806 cause: Cause :: AdditionalNonNullableField ,
805807 base: ( impl_name, impl_type, impl_wrapped_val) ,
806808 implementation: ( impl_name, impl_type, impl_wrapped_val) ,
807809 } ) ;
808810 }
809811 }
810812
811- Ok ( ( ) )
813+ :: core :: result :: Result :: Ok ( ( ) )
812814 }
813815
814- const RES : :: std :: result:: Result <( ) , Error > = check( ) ;
816+ const RES : :: core :: result:: Result <( ) , Error > = check( ) ;
815817 if RES . is_err( ) {
816818 const ERROR : Error = unwrap_error( RES ) ;
817819
@@ -822,7 +824,7 @@ macro_rules! assert_field_args {
822824 const IMPL_TYPE_FORMATTED : & str =
823825 $crate:: format_type!( ERROR . implementation. 1 , ERROR . implementation. 2 ) ;
824826
825- const MSG : & str = match ERROR . cause {
827+ const MSG : & :: core :: primitive :: str = match ERROR . cause {
826828 Cause :: TypeMismatch => {
827829 $crate:: const_concat!(
828830 "Argument `" ,
@@ -865,9 +867,9 @@ macro_rules! assert_field_args {
865867#[ macro_export]
866868macro_rules! const_concat {
867869 ( $( $s: expr) ,* $( , ) ?) => { {
868- const LEN : usize = 0 $( + $s. as_bytes( ) . len( ) ) * ;
869- const CNT : usize = [ $( $s) ,* ] . len( ) ;
870- const fn concat( input: [ & str ; CNT ] ) -> [ u8 ; LEN ] {
870+ const LEN : :: core :: primitive :: usize = 0 $( + $s. as_bytes( ) . len( ) ) * ;
871+ const CNT : :: core :: primitive :: usize = [ $( $s) ,* ] . len( ) ;
872+ const fn concat( input: [ & :: core :: primitive :: str ; CNT ] ) -> [ :: core :: primitive :: u8 ; LEN ] {
871873 let mut bytes = [ 0 ; LEN ] ;
872874 let ( mut i, mut byte) = ( 0 , 0 ) ;
873875 while i < CNT {
@@ -881,12 +883,12 @@ macro_rules! const_concat {
881883 }
882884 bytes
883885 }
884- const CON : [ u8 ; LEN ] = concat( [ $( $s) ,* ] ) ;
886+ const CON : [ :: core :: primitive :: u8 ; LEN ] = concat( [ $( $s) ,* ] ) ;
885887
886888 // TODO: Use `.unwrap()` once it becomes `const`.
887- match :: std :: str :: from_utf8( & CON ) {
888- :: std :: result:: Result :: Ok ( s) => s,
889- _ => unreachable!( ) ,
889+ match :: core :: str :: from_utf8( & CON ) {
890+ :: core :: result:: Result :: Ok ( s) => s,
891+ _ => :: core :: unreachable!( ) ,
890892 }
891893 } } ;
892894}
@@ -936,13 +938,13 @@ macro_rules! format_type {
936938 ) = ( $ty, $wrapped_value) ;
937939 const RES_LEN : usize = $crate:: macros:: reflect:: type_len_with_wrapped_val( TYPE . 0 , TYPE . 1 ) ;
938940
939- const OPENING_BRACKET : & str = "[" ;
940- const CLOSING_BRACKET : & str = "]" ;
941- const BANG : & str = "!" ;
941+ const OPENING_BRACKET : & :: core :: primitive :: str = "[" ;
942+ const CLOSING_BRACKET : & :: core :: primitive :: str = "]" ;
943+ const BANG : & :: core :: primitive :: str = "!" ;
942944
943- const fn format_type_arr( ) -> [ u8 ; RES_LEN ] {
945+ const fn format_type_arr( ) -> [ :: core :: primitive :: u8 ; RES_LEN ] {
944946 let ( ty, wrap_val) = TYPE ;
945- let mut type_arr: [ u8 ; RES_LEN ] = [ 0 ; RES_LEN ] ;
947+ let mut type_arr: [ :: core :: primitive :: u8 ; RES_LEN ] = [ 0 ; RES_LEN ] ;
946948
947949 let mut current_start = 0 ;
948950 let mut current_end = RES_LEN - 1 ;
@@ -1003,13 +1005,14 @@ macro_rules! format_type {
10031005 type_arr
10041006 }
10051007
1006- const TYPE_ARR : [ u8 ; RES_LEN ] = format_type_arr( ) ;
1008+ const TYPE_ARR : [ :: core :: primitive :: u8 ; RES_LEN ] = format_type_arr( ) ;
10071009
10081010 // TODO: Use `.unwrap()` once it becomes `const`.
1009- const TYPE_FORMATTED : & str = match :: std:: str :: from_utf8( TYPE_ARR . as_slice( ) ) {
1010- :: std:: result:: Result :: Ok ( s) => s,
1011- _ => unreachable!( ) ,
1012- } ;
1011+ const TYPE_FORMATTED : & :: core:: primitive:: str =
1012+ match :: core:: str :: from_utf8( TYPE_ARR . as_slice( ) ) {
1013+ :: core:: result:: Result :: Ok ( s) => s,
1014+ _ => unreachable!( ) ,
1015+ } ;
10131016
10141017 TYPE_FORMATTED
10151018 } } ;
0 commit comments