File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn cast_dangling() {
3535fn format ( ) {
3636 // Pointer string formatting! We can't check the output as it changes when libstd changes,
3737 // but we can make sure Miri does not error.
38- format ! ( "{:?}" , & mut 13 as * mut _) ;
38+ let _ = format ! ( "{:?}" , & mut 13 as * mut _) ;
3939}
4040
4141fn transmute ( ) {
@@ -52,7 +52,7 @@ fn ptr_bitops1() {
5252 let one = bytes. as_ptr ( ) . wrapping_offset ( 1 ) ;
5353 let three = bytes. as_ptr ( ) . wrapping_offset ( 3 ) ;
5454 let res = ( one as usize ) | ( three as usize ) ;
55- format ! ( "{}" , res) ;
55+ let _ = format ! ( "{}" , res) ;
5656}
5757
5858fn ptr_bitops2 ( ) {
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ fn test_derive() {
138138 assert_eq ! ( x. partial_cmp( & y) . unwrap( ) , x. cmp( & y) ) ;
139139 x. hash ( & mut DefaultHasher :: new ( ) ) ;
140140 P :: default ( ) ;
141- format ! ( "{:?}" , x) ;
141+ let _ = format ! ( "{:?}" , x) ;
142142}
143143
144144fn main ( ) {
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ fn test_errors() {
202202 // Opening a non-existing file should fail with a "not found" error.
203203 assert_eq ! ( ErrorKind :: NotFound , File :: open( & path) . unwrap_err( ) . kind( ) ) ;
204204 // Make sure we can also format this.
205- format ! ( "{0}: {0:?}" , File :: open( & path) . unwrap_err( ) ) ;
205+ let _ = format ! ( "{0}: {0:?}" , File :: open( & path) . unwrap_err( ) ) ;
206206 // Removing a non-existing file should fail with a "not found" error.
207207 assert_eq ! ( ErrorKind :: NotFound , remove_file( & path) . unwrap_err( ) . kind( ) ) ;
208208 // Reading the metadata of a non-existing file should fail with a "not found" error.
@@ -301,5 +301,5 @@ fn test_from_raw_os_error() {
301301 let error = Error :: from_raw_os_error ( code) ;
302302 assert ! ( matches!( error. kind( ) , ErrorKind :: Uncategorized ) ) ;
303303 // Make sure we can also format this.
304- format ! ( "{error:?}" ) ;
304+ let _ = format ! ( "{error:?}" ) ;
305305}
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ fn main() {
1515 panic ! ( "unsupported OS" )
1616 } ;
1717 let err = io:: Error :: from_raw_os_error ( raw_os_error) ;
18- format ! ( "{err}: {err:?}" ) ;
18+ let _ = format ! ( "{err}: {err:?}" ) ;
1919}
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ fn main() {
3131 }
3232
3333 // Regression test for Debug impl's
34- format ! ( "{:?} {:?}" , dst, dst. iter( ) ) ;
35- format ! ( "{:?}" , VecDeque :: <u32 >:: new( ) . iter( ) ) ;
34+ let _ = format ! ( "{:?} {:?}" , dst, dst. iter( ) ) ;
35+ let _ = format ! ( "{:?}" , VecDeque :: <u32 >:: new( ) . iter( ) ) ;
3636
3737 for a in dst {
3838 assert_eq ! ( * a, 2 ) ;
You can’t perform that action at this time.
0 commit comments