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
tests: add test for empty <> #32023
tests: add test for empty <> #32023
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
let _ = S; | ||
let _ = S::<>; | ||
let _ = E::V; | ||
let _ = E::<>::V; |
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 is interesting because non-empty parameter lists are not currently allowed in this position.
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.
Well, may be they should not be allowed, but this code compiles on stable, beta and nightly:
https://play.rust-lang.org/?gist=764dd4bd1d5c230a60e4&version=stable
|
e14772a
to
4844f01
Compare
Personally I find it ok that |
cc @rust-lang/lang -- merge the test, or call these cases (or some of these cases) a bug? :) |
@nikomatsakis I tend to agree -- I don't see value in being pedantic here, and it reminds me a bit of the unit struct/empty struct braces situation. I say we add the test. |
@bors r+ |
📌 Commit 4844f01 has been approved by |
tests: add test for empty <> Rust allows to specify an empty list of type and lifetime parameters, but there are no tests for it: ``` user@UNIT-326 [12:53:45] [~/projects/rust] [diamonds-and-rust] -> % grep "<>" -R src/test src/test/compile-fail/generic-type-params-name-repr.rs: // And don't print <> at all when there's just defaults. src/test/debuginfo/issue22656.rs:// when trying to handle a Vec<> or anything else that contains zero-sized ``` So let's add them! Besides it's such a wonderful opportunity to put a reference to Judas Priest band into the branch name ;)
This is valid Rust: rust-lang/rust#32023
Rust allows to specify an empty list of type and lifetime parameters, but there are no tests for it:
So let's add them! Besides it's such a wonderful opportunity to put a reference to Judas Priest band into the branch name ;)