mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	 ceced5322c
			
		
	
	
		ceced5322c
		
	
	
	
	
		
			
			For example:
```rust
let s = "123";
println!({}, "sss", s);
```
Suggest:
`println!("{:?} {} {}", {}, "sss", s);`
fixes #130170
		
	
			
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| error: format argument must be a string literal
 | |
|   --> $DIR/format-empty-block-unit-tuple-suggestion-130170.rs:5:14
 | |
|    |
 | |
| LL |     println!({}, "sss", s);
 | |
|    |              ^^
 | |
|    |
 | |
| help: you might be missing a string literal to format with
 | |
|    |
 | |
| LL |     println!("{:?} {} {}", {}, "sss", s);
 | |
|    |              +++++++++++++
 | |
| 
 | |
| error: format argument must be a string literal
 | |
|   --> $DIR/format-empty-block-unit-tuple-suggestion-130170.rs:7:14
 | |
|    |
 | |
| LL |     println!({});
 | |
|    |              ^^
 | |
|    |
 | |
| help: you might be missing a string literal to format with
 | |
|    |
 | |
| LL |     println!("{:?}", {});
 | |
|    |              +++++++
 | |
| 
 | |
| error: format argument must be a string literal
 | |
|   --> $DIR/format-empty-block-unit-tuple-suggestion-130170.rs:9:14
 | |
|    |
 | |
| LL |     println!(s, "sss", s, {});
 | |
|    |              ^
 | |
|    |
 | |
| help: you might be missing a string literal to format with
 | |
|    |
 | |
| LL |     println!("{} {} {} {:?}", s, "sss", s, {});
 | |
|    |              ++++++++++++++++
 | |
| 
 | |
| error: format argument must be a string literal
 | |
|   --> $DIR/format-empty-block-unit-tuple-suggestion-130170.rs:11:14
 | |
|    |
 | |
| LL |     println!((), s, {});
 | |
|    |              ^^
 | |
|    |
 | |
| help: you might be missing a string literal to format with
 | |
|    |
 | |
| LL |     println!("{:?} {} {:?}", (), s, {});
 | |
|    |              +++++++++++++++
 | |
| 
 | |
| error: aborting due to 4 previous errors
 | |
| 
 |