Skip to content

unterminated raw string error should explain the raw-string format a bit #48395

Closed

Description

Playground:

fn foo(s: &str) { println!("{}", s) }
fn main() {
    foo(r#"
This is a raw string  
missing a # at the end
"
    );
}

produces

error: unterminated raw string
 --> src/main.rs:4:9
  |
4 |       foo(r#"
  |  _________^
5 | | This is a raw string  
6 | | missing a # at the end
7 | | "
8 | |     );
9 | | }
  | |_^

error: aborting due to previous error

that only mentions "unterminated raw-string". It would be more helpful if it would suggest adding a # after the last " to terminate the raw string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsArea: documentation for any part of the project, including the compiler, standard library, and toolsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions