-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
new_ret_no_self should allow Result<Self, E> #3620
Comments
And |
This was already fixed in #3338: Playground struct A;
impl A {
fn new() -> Result<Self, ()> {
Err(())
}
} Feel free to reopen if I misunderstood the issue. EDIT: Link fixed |
Your link just opens the Playground without any specific code. Seems like you just copied the URL instead of using the share button. |
I'm not sure how to test it in the playground, but it's definitely not fixed in the latest release of clippy. It looks like the last release was Oct 5, though, so it's possible that pull request from Oct 19 fixes it. When is the next release planned? |
@scottjmaddox Clippy doesn't have releases, you should install it with rustup: https://github.com/rust-lang/rust-clippy#step-1-install-rustup |
@mati865 I was basing the "releases" on the versions posted at https://crates.io/crates/clippy. I did install through rustup, and it stills says up to date. Perhaps the question I should ask is, when will the version that includes the stated fix be available for install through rustup? |
Oh sorry it was late. There you go: Playground You can test it via Tools -> Clippy in the top right corner
This is deprecated and is only there to point people to rustup. The Clippy version shipped with rustup depends on the toolchain you are using when running
with beta
and nightly
For those interested: The reason the version date of the stable toolchain Clippy is 2018-11-22, is that it refers to https://github.com/rust-lang/rust-clippy/commits/rust-1.31.0 and not the master branch. The latest effective commit there is from the 19.10.2018 though (stable just barely missed this fix). |
new_ret_no_self
currently triggers ifnew()
returnsResult<Self, E>
. I thinknew()
is still an idiomatic name for a constructor even if it can fail, soResult<Self, E>
should be permitted.The text was updated successfully, but these errors were encountered: