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

Handle str literals written with ' lexed as lifetime #122217

Merged
merged 6 commits into from
Mar 24, 2024

Commits on Mar 17, 2024

  1. Handle str literals written with ' lexed as lifetime

    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 rust-lang#119685.
    estebank committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    982918f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4a10b01 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    999a0dc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6f388ef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ea1883d View commit details
    Browse the repository at this point in the history
  6. fix rustdoc test

    estebank committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    f4d30b1 View commit details
    Browse the repository at this point in the history