2

Handle str literals written with `'` lexed as lifetime by estebank · Pull Reques...

 4 weeks ago
source link: https://github.com/rust-lang/rust/pull/122217
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

Given 'hello world' and `'1 str', provide a structured suggestion for a valid string literal:

error[E0762]: unterminated character literal
  --> $DIR/lex-bad-str-literal-as-char-3.rs:2:26
   |
LL |     println!('hello world');
   |                          ^^^^
   |
help: if you meant to write a `str` literal, use double quotes
   |
LL |     println!("hello world");
   |              ~           ~
error[E0762]: unterminated character literal
  --> $DIR/lex-bad-str-literal-as-char-1.rs:2:20
   |
LL |     println!('1 + 1');
   |                    ^^^^
   |
help: if you meant to write a `str` literal, use double quotes
   |
LL |     println!("1 + 1");
   |              ~     ~

Fix #119685.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK