Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow lifetime followed immediately by single quote #260

Merged
merged 2 commits into from
Sep 26, 2020
Merged

Disallow lifetime followed immediately by single quote #260

merged 2 commits into from
Sep 26, 2020

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Sep 26, 2020

This is not lexed as two consecutive lifetime tokens in Rust.

macro_rules! m {
    ($($tt:tt)*) => {};
}

m!('aa'aa);
error: character literal may only contain one codepoint
 --> src/main.rs:5:4
  |
5 | m!('aa'aa);
  |    ^^^^
  |
help: if you meant to write a `str` literal, use double quotes
  |
5 | m!("aa"aa);
  |    ^^^^

@dtolnay dtolnay merged commit 5d5fdb3 into dtolnay:master Sep 26, 2020
@dtolnay dtolnay deleted the lit branch September 26, 2020 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant