File tree 5 files changed +8
-8
lines changed
5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn cast_dangling() {
35
35
fn format ( ) {
36
36
// Pointer string formatting! We can't check the output as it changes when libstd changes,
37
37
// but we can make sure Miri does not error.
38
- format ! ( "{:?}" , & mut 13 as * mut _) ;
38
+ let _ = format ! ( "{:?}" , & mut 13 as * mut _) ;
39
39
}
40
40
41
41
fn transmute ( ) {
@@ -52,7 +52,7 @@ fn ptr_bitops1() {
52
52
let one = bytes. as_ptr ( ) . wrapping_offset ( 1 ) ;
53
53
let three = bytes. as_ptr ( ) . wrapping_offset ( 3 ) ;
54
54
let res = ( one as usize ) | ( three as usize ) ;
55
- format ! ( "{}" , res) ;
55
+ let _ = format ! ( "{}" , res) ;
56
56
}
57
57
58
58
fn ptr_bitops2 ( ) {
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ fn test_derive() {
138
138
assert_eq ! ( x. partial_cmp( & y) . unwrap( ) , x. cmp( & y) ) ;
139
139
x. hash ( & mut DefaultHasher :: new ( ) ) ;
140
140
P :: default ( ) ;
141
- format ! ( "{:?}" , x) ;
141
+ let _ = format ! ( "{:?}" , x) ;
142
142
}
143
143
144
144
fn main ( ) {
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ fn test_errors() {
202
202
// Opening a non-existing file should fail with a "not found" error.
203
203
assert_eq ! ( ErrorKind :: NotFound , File :: open( & path) . unwrap_err( ) . kind( ) ) ;
204
204
// 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( ) ) ;
206
206
// Removing a non-existing file should fail with a "not found" error.
207
207
assert_eq ! ( ErrorKind :: NotFound , remove_file( & path) . unwrap_err( ) . kind( ) ) ;
208
208
// 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() {
301
301
let error = Error :: from_raw_os_error ( code) ;
302
302
assert ! ( matches!( error. kind( ) , ErrorKind :: Uncategorized ) ) ;
303
303
// Make sure we can also format this.
304
- format ! ( "{error:?}" ) ;
304
+ let _ = format ! ( "{error:?}" ) ;
305
305
}
Original file line number Diff line number Diff line change @@ -15,5 +15,5 @@ fn main() {
15
15
panic ! ( "unsupported OS" )
16
16
} ;
17
17
let err = io:: Error :: from_raw_os_error ( raw_os_error) ;
18
- format ! ( "{err}: {err:?}" ) ;
18
+ let _ = format ! ( "{err}: {err:?}" ) ;
19
19
}
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ fn main() {
31
31
}
32
32
33
33
// 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( ) ) ;
36
36
37
37
for a in dst {
38
38
assert_eq ! ( * a, 2 ) ;
You can’t perform that action at this time.
0 commit comments