-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
macros: allow a path
fragment to be parsed as a type parameter bound
#38279
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
It has failed. Is it me? |
It looks like the failure is not related to the PR, it ran all tests successfully. Unfortunately all PRs fail on travis right now: https://travis-ci.org/rust-lang/rust/builds |
Hi @bluss, Thank you for the explanation. Should I just wait or what? Regards, |
Wait or maybe seek out and ask someone if they want to review your PR. It's not my area, so I will not review it. |
@KalitaAlexey @nrc will review soon, but has been traveling lately. |
Hi @brson, I'll wait. It's not problem. Regards, |
} | ||
_ => break, | ||
} | ||
} | ||
token::ModSep | token::Ident(..) => { |
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.
Instead of adding the token::Interpolated(ref nt) => { ... }
arm, I believe you could just change this pattern to
_ if self.token.is_path_start() || self.token.is_keyword(keywords::For) => { ... }
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.
I'll examine your suggestion.
trait Foo {} | ||
|
||
macro_rules! foo(($t:path) => { | ||
impl<T: $t> Foo for T {} |
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.
nit: indent 4 spaces
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.
I'll fix it.
foo!(m::m2::A); | ||
|
||
fn main() {} | ||
|
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.
nit: trailing newline (in both tests)
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.
I'll fix it.
path
fragment to be parsed as a type parameter bound
Hi @jseyfried, Could you look at it? Thanks |
|
I don't know why, but my PR enough to break the test. Thanks |
That sounds unrelated to this PR, but I don't have enough information to help debug further. Could you provide hash of the commit that breaks the test, the exact output when it crashes, and ideally a backtrace? |
Hm. Actually my installed rustc also creates an executable failing with segfault. |
@KalitaAlexey Can you attempt to provide a backtrace? Either way, please file a new issue (since this seems unrelated to this PR), with your OS distro and version, as well as rustc version so we can try to diagnose. I just verified locally, and it doesn't segfault for me. |
Never mind. I had forgotten to run the produced executable, will post the new issue myself once I get a backtrace if you don't get to it first. |
Oh. That tests currently doesn't support non-optimized codegen (no |
Hi @Mark-Simulacrum, I just ran |
Hi @jseyfried, I applied your suggestions. Thanks. |
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.
r=me modulo nit
foo2!(B<C>); | ||
|
||
fn main() {} | ||
|
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.
nit: trailing newline
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.
Hm. Right.
@@ -0,0 +1,35 @@ | |||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT |
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.
nit: 2016
, not 2014
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.
I'll fix it.
@jseyfried, I've done it. |
@KalitaAlexey Thanks! |
@jseyfried, how should I do it? I don't know right way. |
|
22c2089
to
12a6cf1
Compare
I've done what you had suggested me. Thank you. |
@bors r+ |
📌 Commit 12a6cf1 has been approved by |
⌛ Testing commit 12a6cf1 with merge 9652757... |
💔 Test failed - auto-win-msvc-64-opt |
@bors retry clean |
⌛ Testing commit 12a6cf1 with merge bf9e5a8... |
💔 Test failed - auto-win-msvc-64-opt |
@bors: retry |
⌛ Testing commit 12a6cf1 with merge ec8bb45... |
macros: allow a `path` fragment to be parsed as a type parameter bound Allow a `path` fragment to be parsed as a type parameter bound. Fixes #8521.
Allow a
path
fragment to be parsed as a type parameter bound.Fixes #8521.