-
Notifications
You must be signed in to change notification settings - Fork 162
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 multiline strings #1399
Comments
As a side-note, I haven't been able to understand the new system which can emits errors based on locale. I'll have to ask on the Rust zulip for an explanation or a PR link, as I couldn't figure out where that error was emitted without checking out the 1.49 release |
The error is emitted as #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_bad_char)]
pub struct DocAliasBadChar<'a> {
#[primary_span]
pub span: Span,
pub attr_str: &'a str,
pub char_: char,
} The actual error message is declared in compiler/rustc_error_messages/locales/en-US/passes.ftl as |
I found the error message but couldn't figure out the Diagnostic or how it was emitted. Thanks a lot @bjorn3 :DD |
Seems like a fixed issue as of b5c354d |
|
Thanks @liamnaddell! Good catch |
Regression checks for Rust-GCC#1399 gcc/testsuite/ChangeLog: * rust/compile/multiline-string.rs: New test. * rust/execute/torture/multiline-string.rs: New test.
Regression checks for Rust-GCC#1399 gcc/testsuite/ChangeLog: * rust/compile/multiline-string.rs: New test. * rust/execute/torture/multiline-string.rs: New test.
Multiline strings are allowed in Rust (playground link), however we currently do not handle them correctly:
This is the beginning of a patch to fix that, basically commenting the checks for a
\n
character:However, that code is necessary for properly handling some documentation attributes, as pointed out by various test cases in our testsuite.
rustc
does this in a different pass rather than the lexer, which is what I think we should do as well. We could for example add that check after parsing adoc_attr
.Here is the relevant rustc code which checks for certain characters:
This issue is necessary for compiling certain versions of libcore properly, which do contain multiline strings.
The text was updated successfully, but these errors were encountered: