@@ -1919,21 +1919,21 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
1919
1919
use rustc:: ty:: TyKind :: * ;
1920
1920
match ty. kind {
1921
1921
// 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 ) ) ,
1926
1926
RawPtr ( tm) if matches ! ( tm. ty. kind, Dynamic ( ..) ) =>
1927
1927
// raw ptr to dyn Trait
1928
1928
{
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 ) )
1930
1930
}
1931
1931
// Primitive types with other constraints.
1932
1932
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 ) )
1934
1934
}
1935
1935
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 ) )
1937
1937
}
1938
1938
// Recurse and checks for some compound types.
1939
1939
Adt ( adt_def, substs) if !adt_def. is_union ( ) => {
@@ -1961,7 +1961,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
1961
1961
}
1962
1962
// Now, recurse.
1963
1963
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 ) ) ,
1965
1965
1 => {
1966
1966
// Struct, or enum with exactly one variant.
1967
1967
// Proceed recursively, check all fields.
0 commit comments