Skip to content

Conversation

omasanori
Copy link
Contributor

No description provided.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
@flaper87
Copy link
Contributor

ops... lgtm

@bors bors closed this Jan 20, 2014
@bors bors merged commit 6b18ef5 into rust-lang:master Jan 20, 2014
@omasanori omasanori deleted the sep-doc branch January 20, 2014 22:35
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 21, 2023
[`unnecessary_lazy_eval`]: reduce applicability if closure has return type annotation

Fixes rust-lang#11672

We already check if closure parameters don't have type annotations and reduce the applicability to `MaybeIncorrect` if they do, since those help type inference and removing them breaks code. We didn't do this for return type annotations however. This PR adds it. This doesn't change it to produce a fix that will compile, but it will prevent rustfix from auto-applying it.

(In general I'm not sure if we can suggest a fix that will compile. In this specific example, it might be possible to suggest `&[] as &[u8]`, but as-casts won't always work, e.g. `Default::default() as &[u8]` is a compile error, so just reducing applicability should be a safe fix in any case for now)

changelog: [`unnecessary_lazy_eval`]: reduce applicability to `MaybeIncorrect` if closure has return type annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants