Skip to content

Conversation

apasel422
Copy link
Contributor

  • Remove the for Sized? bound on core::ops::FnOnce, as it takes self by value and can never be implemented by an unsized type.
  • Add a missing Sized? bound to the blanket core::ops::FnMut impl, as both Fn and FnMut are for Sized?.

- Remove the `for Sized?` bound on `core::ops::FnOnce`, as it takes
  `self` by value and can never be implemented by an unsized type.
- Add a missing `Sized?` bound to the blanket `core::ops::FnMut` impl,
  as both `Fn` and `FnMut` are `for Sized?`.
@apasel422
Copy link
Contributor Author

Frankly, I'm not sure how useful it is for Fn and FnMut to be for Sized? either.

@apasel422
Copy link
Contributor Author

In #19467, types implementing these traits are passed by value. For example:

fn filter<P>(self, predicate: P) -> Filter<A, Self, P> where P: FnMut(&A)

So unsized types that implement the traits won't be usable there.

bors added a commit that referenced this pull request Dec 10, 2014
- Remove the `for Sized?` bound on `core::ops::FnOnce`, as it takes `self` by value and can never be implemented by an unsized type.
- Add a missing `Sized?` bound to the blanket `core::ops::FnMut` impl, as both `Fn` and `FnMut` are `for Sized?`.
@bors bors closed this Dec 10, 2014
@apasel422 apasel422 deleted the sized_fn_once branch December 10, 2014 03:28
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 28, 2025
internal: Render sigantures with view hir command
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.

2 participants