-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Ensure that generic arguments don't end up in attribute paths. #43948
Conversation
src/libsyntax/parse/parser.rs
Outdated
maybe_whole!(self, NtPath, |path| { | ||
if style == PathStyle::Mod && path.segments.iter().any(|segment| segment.parameters.is_some()) { | ||
self.diagnostic().span_err(path.span, "unexpected generic arguments in path"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't catch arguments produced by procedural macros, but I guess that's more or less okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legacy procedural macros or procedural macros 2.0?
I don't think this is an issue for procedural macros 2.0 since they can't generate AST directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the legacy ones.
IIRC, there should be fallout from other compile-fail / ui tests. |
|
2f3de01
to
608e1fa
Compare
Needs rebase as well. |
cb24b98
to
7e4c242
Compare
☔ The latest upstream changes (presumably #43540) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors: p=1 (beta backport) |
7e4c242
to
7e19168
Compare
ping @petrochenkov for review - this is getting close to beta |
@bors r+ |
📌 Commit 7e19168 has been approved by |
⌛ Testing commit 7e19168 with merge 06b0273ed2b8c2d38fe4c1257169a4287377015a... |
💔 Test failed - status-appveyor |
…henkov Ensure that generic arguments don't end up in attribute paths. Fixes #43424. r? @petrochenkov or @nrc
☀️ Test successful - status-appveyor, status-travis |
Marking as beta-accepted. Small patch. Stops us from accepting bad paths. cc @rust-lang/compiler |
Fixes #43424.
r? @petrochenkov or @nrc