@@ -1919,21 +1919,21 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
19191919 use rustc:: ty:: TyKind :: * ;
19201920 match ty. kind {
19211921 // Primitive types that don't like 0 as a value.
1922- Ref ( ..) => Some ( ( format ! ( "references must be non-null" ) , None ) ) ,
1923- Adt ( ..) if ty. is_box ( ) => Some ( ( format ! ( "`Box` must be non-null" ) , None ) ) ,
1924- FnPtr ( ..) => Some ( ( format ! ( "function pointers must be non-null" ) , None ) ) ,
1925- Never => Some ( ( format ! ( "the `!` type has no valid value" ) , None ) ) ,
1922+ Ref ( ..) => Some ( ( "references must be non-null" . to_string ( ) , None ) ) ,
1923+ Adt ( ..) if ty. is_box ( ) => Some ( ( "`Box` must be non-null" . to_string ( ) , None ) ) ,
1924+ FnPtr ( ..) => Some ( ( "function pointers must be non-null" . to_string ( ) , None ) ) ,
1925+ Never => Some ( ( "the `!` type has no valid value" . to_string ( ) , None ) ) ,
19261926 RawPtr ( tm) if matches ! ( tm. ty. kind, Dynamic ( ..) ) =>
19271927 // raw ptr to dyn Trait
19281928 {
1929- Some ( ( format ! ( "the vtable of a wide raw pointer must be non-null" ) , None ) )
1929+ Some ( ( "the vtable of a wide raw pointer must be non-null" . to_string ( ) , None ) )
19301930 }
19311931 // Primitive types with other constraints.
19321932 Bool if init == InitKind :: Uninit => {
1933- Some ( ( format ! ( "booleans must be either `true` or `false`" ) , None ) )
1933+ Some ( ( "booleans must be either `true` or `false`" . to_string ( ) , None ) )
19341934 }
19351935 Char if init == InitKind :: Uninit => {
1936- Some ( ( format ! ( "characters must be a valid Unicode codepoint" ) , None ) )
1936+ Some ( ( "characters must be a valid Unicode codepoint" . to_string ( ) , None ) )
19371937 }
19381938 // Recurse and checks for some compound types.
19391939 Adt ( adt_def, substs) if !adt_def. is_union ( ) => {
@@ -1961,7 +1961,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
19611961 }
19621962 // Now, recurse.
19631963 match adt_def. variants . len ( ) {
1964- 0 => Some ( ( format ! ( "enums with no variants have no valid value" ) , None ) ) ,
1964+ 0 => Some ( ( "enums with no variants have no valid value" . to_string ( ) , None ) ) ,
19651965 1 => {
19661966 // Struct, or enum with exactly one variant.
19671967 // Proceed recursively, check all fields.
0 commit comments