@@ -947,7 +947,7 @@ impl Punct {
947
947
':' , '#' , '$' , '?' , '\'' ,
948
948
] ;
949
949
if !LEGAL_CHARS . contains ( & ch) {
950
- panic ! ( "unsupported character `{:?}`" , ch ) ;
950
+ panic ! ( "unsupported character `{ch :?}`" ) ;
951
951
}
952
952
Punct ( bridge:: Punct {
953
953
ch : ch as u8 ,
@@ -1310,7 +1310,7 @@ impl Literal {
1310
1310
/// String literal.
1311
1311
#[ stable( feature = "proc_macro_lib2" , since = "1.29.0" ) ]
1312
1312
pub fn string ( string : & str ) -> Literal {
1313
- let quoted = format ! ( "{:?}" , string ) ;
1313
+ let quoted = format ! ( "{string :?}" ) ;
1314
1314
assert ! ( quoted. starts_with( '"' ) && quoted. ends_with( '"' ) ) ;
1315
1315
let symbol = & quoted[ 1 ..quoted. len ( ) - 1 ] ;
1316
1316
Literal :: new ( bridge:: LitKind :: Str , symbol, None )
@@ -1319,7 +1319,7 @@ impl Literal {
1319
1319
/// Character literal.
1320
1320
#[ stable( feature = "proc_macro_lib2" , since = "1.29.0" ) ]
1321
1321
pub fn character ( ch : char ) -> Literal {
1322
- let quoted = format ! ( "{:?}" , ch ) ;
1322
+ let quoted = format ! ( "{ch :?}" ) ;
1323
1323
assert ! ( quoted. starts_with( '\'' ) && quoted. ends_with( '\'' ) ) ;
1324
1324
let symbol = & quoted[ 1 ..quoted. len ( ) - 1 ] ;
1325
1325
Literal :: new ( bridge:: LitKind :: Char , symbol, None )
0 commit comments