if your rust function takes some type T: IntoIterator, and a caller passes a Box<dyn Iterator>, what's the effect of calling Box::new(arg.into_iter()) does it return the original box unmodified, unbox and rebox it, double-box it...?
It's a single box. I think to find out what's "actually" happening you might have to look at the compiler output, which I don't know how to read. https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=28ff79ba9f2f05a86bdd8fb2ff784c23 …
-
-
so I'm talking about a function of the kind of my_func here https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e9ebd97742a8519bd509cd94bd9a7b43 …
-
I'm a long way from Rust mastery, so I may be missing something, but I don't see how the function changes things. If you monomorphize the function and then inline it in main, it's the same code.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.