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...?
-
-
well except that if the compile only knows that arg: IntoIterator, it doesn't know the concrete type at runtime is Box<dyn Iterator>
-
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 …
- 2 more replies
New conversation -
-
-
good point
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.