mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			443 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			443 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // When a char literal is used where a str should be,
 | |
| // suggest changing to double quotes.
 | |
| 
 | |
| //@ run-rustfix
 | |
| 
 | |
| fn main() {
 | |
|     let _: &str = 'a';   //~ ERROR mismatched types
 | |
|     let _: &str = '"""'; //~ ERROR character literal may only contain one codepoint
 | |
|     let _: &str = '\"\"\"'; //~ ERROR character literal may only contain one codepoint
 | |
|     let _: &str = '"\"\\"\\\"\\\\"'; //~ ERROR character literal may only contain one codepoint
 | |
| }
 | 
