Skip to content
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

(RFC) option: rewrite the API to use composition #9359

Merged
merged 1 commit into from
Oct 9, 2013
Merged

(RFC) option: rewrite the API to use composition #9359

merged 1 commit into from
Oct 9, 2013

Conversation

thestinger
Copy link
Contributor

See #9355 for discussion.

@brson
Copy link
Contributor

brson commented Sep 20, 2013

Let's please make sure we get enough consensus on this before merging.

@emberian
Copy link
Member

A hearty +1

@bluss
Copy link
Member

bluss commented Sep 26, 2013

Once you thunk it, you can't unthink it. A great change.

@alexcrichton
Copy link
Member

We discussed this in the meeting today and have concluded that we'd like to include this. The consensus, though, was that the following changes should be made:

  • as_imm => as_ref
  • get_ref/get_mut are so common they should probably stick around (but only these two, not any of the others)

We figured that unwrap vs get is also a little contentious, but that's probably another issue.

bors added a commit that referenced this pull request Oct 9, 2013
@bors bors merged commit 6a90e80 into rust-lang:master Oct 9, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 31, 2023
[`unused_async`]: don't lint if paths reference async fn without immediate call

Fixes rust-lang#9695
Fixes rust-lang#9359

Clippy shouldn't lint unused `async` if there are paths referencing them if that path isn't the receiver of a function call, because that means that the function might be passed to some other function:
```rs
async fn f() {} // No await statements, so unused at this point

fn requires_fn_future<F: Future<Output = ()>>(_: fn() -> F) {}
requires_fn_future(f); // `f`'s asyncness is actually not unused.
```
(This isn't limited to just passing the function as a parameter to another function, it could also first be stored in a variable and later passed to another function as an argument)

This requires delaying the linting until post-crate and collecting path references to local async functions along the way.

changelog: [`unused_async`]: don't lint if paths reference async fn that require asyncness
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.

6 participants