syntax: Keep string literals in ABIs and asm! more precisely#66271
syntax: Keep string literals in ABIs and asm! more precisely#66271bors merged 6 commits intorust-lang:masterfrom
asm! more precisely#66271Conversation
This comment has been minimized.
This comment has been minimized.
Centril
left a comment
There was a problem hiding this comment.
Looks good so far! Waiting for the tests for the remainder of the review. :)
src/libsyntax/parse/parser/expr.rs
Outdated
There was a problem hiding this comment.
Hmm; should we perhaps recover here instead with e.g. LitKind::Err(Option<Symbol>)? cc @estebank
There was a problem hiding this comment.
This is ok as is. Recovery of parse_lit would have to be aware of what the caller expects after the Lit. If anything this should be a struct_span_err instead and let the caller handle it.
There was a problem hiding this comment.
I generally didn't change any diagnostics in this PR.
I can try turning this into an "expected literal, found X" error.
There was a problem hiding this comment.
Nah, infinite recursion happens in attribute parsing if something non-span_fatal is returned (e.g. self.unexpected()), I remember I've seen this before.
Leaving for some future PR.
Revert weird renaming of the former `LitError::report`
|
Updated. |
|
r=me with the typo fixed |
|
@bors r=Centril |
|
📌 Commit 28aec1b has been approved by |
syntax: Keep string literals in ABIs and `asm!` more precisely As a result we don't lose spans when `extern` functions or blocks are passed to proc macros, and also escape all string literals consistently. Continuation of rust-lang#60679, which did a similar thing with all literals besides those in ABIs and `asm!`. TODO: Add tests. Fixes rust-lang#60493 Fixes rust-lang#64561 r? @Centril
|
⌛ Testing commit 28aec1b with merge f80bed9be489ceab0c403381dd4014f2fb96b7ab... |
syntax: Keep string literals in ABIs and `asm!` more precisely As a result we don't lose spans when `extern` functions or blocks are passed to proc macros, and also escape all string literals consistently. Continuation of rust-lang#60679, which did a similar thing with all literals besides those in ABIs and `asm!`. TODO: Add tests. Fixes rust-lang#60493 Fixes rust-lang#64561 r? @Centril
|
@bors retry rolled up |
Rollup of 11 pull requests Successful merges: - #65739 (Improve documentation of `Vec::split_off(...)`) - #66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - #66344 (rustc_plugin: Remove `Registry::register_attribute`) - #66381 (find_deprecation: deprecation attr may be ill-formed meta.) - #66395 (Centralize panic macro documentation) - #66456 (Move `DIAGNOSTICS` usage to `rustc_driver`) - #66465 (add missing 'static lifetime in docs) - #66466 (miri panic_unwind: fix hack for SEH platforms) - #66469 (Use "field is never read" instead of "field is never used") - #66471 (Add test for issue 63116) - #66477 (Clarify transmute_copy documentation example) Failed merges: r? @ghost
Rustup to rustc 1.41.0-nightly (35ef33a 2019-11-21) I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by messense/rustc-test#3 List of rustups: - rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0) - rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`) - rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types) - rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default) changelog: none
Rustup to rustc 1.41.0-nightly (35ef33a 2019-11-21) I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by messense/rustc-test#3 List of rustups: - rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0) - rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`) - rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types) - rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default) changelog: none
Rustup to rustc 1.41.0-nightly (35ef33a 2019-11-21) I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by messense/rustc-test#3 List of rustups: - rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0) - rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`) - rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types) - rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default) changelog: none
Updates to account for changes in rust-lang/rust#66271
As a result we don't lose spans when
externfunctions or blocks are passed to proc macros, and also escape all string literals consistently.Continuation of #60679, which did a similar thing with all literals besides those in ABIs and
asm!.TODO: Add tests.
Fixes #60493
Fixes #64561
r? @Centril