Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMake Clone a lang-item and implement it for closures whose members are all Clone #1369
Comments
arielb1
changed the title
Make Clone a lang-item
Make Clone a lang-item and implement it for closures whose members are all Clone
Nov 14, 2015
This comment has been minimized.
This comment has been minimized.
|
Could this be implemented using default impls of |
This comment has been minimized.
This comment has been minimized.
|
This is also needed to fix rust-lang/rust#28229 |
This comment has been minimized.
This comment has been minimized.
mitchmindtree
commented
Jul 6, 2016
|
Just thought I'd
|
This comment has been minimized.
This comment has been minimized.
|
Not just closures. Functions and arrays would be great as well. |
nrc
added
T-lang
T-libs
labels
Aug 19, 2016
This comment has been minimized.
This comment has been minimized.
J-F-Liu
commented
Jan 22, 2017
|
Meet this same issue, here is an example: #[derive(Debug)]
struct Take(String);
fn make<F>(func: F) -> Box<Fn(&str) -> Take>
where F: FnOnce(String) -> Take + Copy + 'static
{
Box::new(move |s| {
func(s.to_string())
})
}
fn main() {
let m = make(|s|Take(s));
println!("{:?}", m("abc"));
}should compile. |
This comment has been minimized.
This comment has been minimized.
russellmcc
commented
Apr 20, 2017
|
I've started hitting this a lot, mostly in the "iterator ergonomics" that @mitchmindtree mentioned. I'm not sure why |
This comment has been minimized.
This comment has been minimized.
|
Since |
This comment has been minimized.
This comment has been minimized.
|
Since the RFC was accepted, closing in favour of the tracking issue rust-lang/rust#44490 |
arielb1 commentedNov 14, 2015
moved from rust-lang/rust#23501