-
Notifications
You must be signed in to change notification settings - Fork 13.3k
parser: Collect tokens for values in key-value attributes #81337
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
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. |
⌛ Trying commit bd07165 with merge 2d1533fed9e0f5f4c94ef0bf054bd1fb1bd8dbfc... |
☀️ Try build successful - checks-actions |
Queued 2d1533fed9e0f5f4c94ef0bf054bd1fb1bd8dbfc with parent 72c7b70, future comparison URL. @rustbot label: +S-waiting-on-perf |
Can you also update |
@Aaron1011 |
Finished benchmarking try commit (2d1533fed9e0f5f4c94ef0bf054bd1fb1bd8dbfc): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
@bors r+ |
📌 Commit bd07165 has been approved by |
☀️ Test successful - checks-actions |
@petrochenkov or @Aaron1011, this does not apply cleanly to the beta branch. Do you have some guidance on making it work? The issue is that This is somewhat time sensitive since beta will be rolling out soon. |
@ehuss: On beta, you should do |
Hmm, the following change (on top of this PR): diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 760e141b1be..501b6d61e61 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -974,7 +974,8 @@ fn parse_mac_args_common(&mut self, delimited_only: bool) -> PResult<'a, MacArgs
}
// Collect tokens because they are used during lowering to HIR.
- let expr = self.collect_tokens(|this| this.parse_expr())?;
+ let (mut expr, tokens) = self.collect_tokens(|this| this.parse_expr())?;
+ expr.tokens = tokens;
let span = expr.span;
match &expr.kind { results in the error:
Did I misinterpret what you meant? |
That change looks correct - I'm not sure why the ICE is still happening. |
The change looks correct to me too (except that we do |
@Aaron1011 Looks like on beta the pretty-print-reparse hack is not removed yet, so @ehuss I suggest to backport this fragment petrochenkov@e4e460b of #81307 instead, it fixes the underlying problem with span arithmetic. |
@petrochenkov cherry-picked that commit into the stable PR! |
…lbini Rust 1.50.0 stable release This PR builds the artifacts for the 1.50.0 stable release, and: * Cherry-picks e4e460b to fix rust-lang#81208, as recommended in rust-lang#81337 (comment). * Backports the release notes of 1.49.0 and 1.50.0. r? `@ghost` cc `@rust-lang/release`
Fixes #81208 which happens when we parse the attribute value for the second time with an overridden span to synthesize tokens.
It also may be faster to collect tokens instead of re-synthesizing them.