Box<T> in rust book


#1

Hi,

I was irritated seeing a note respective Box, but never seeing a chapter with some information before. It is mentioned in Object Traits:

http://doc.rust-lang.org/book/trait-objects.html

There is a small chapter about Box in the chapter “Nightly Rust”, but no further explanation:

http://doc.rust-lang.org/book/box-syntax-and-patterns.html

I think, this should be fixed somehow.

Best regards,
Stefano


#2

Well, trait objects are one of the two or three small times you want to use a box, for sure. And http://doc.rust-lang.org/stable/std/boxed/ has some info as well.

That said, you’re right we could add a little bit more.


#3

I was bummed to find this lacking too. Once I see what it is, it’s pretty clear, but still +1 on a small book addition.

[[ tangent! ]]

@steveklabnik I followed the link you send, which is exactly the starting point I needed. But I found one oddity: If you click on into_raw and read the docs, you learn of from_raw. This makes sense since they are defined separately, into as “member fn” and from as static fn. (Sorry, I dunno the rust lingo for these, yet.)

My (now clearly tangential) question for you: is there a clever way to cross link these sorts of clearly related functions, so that into_raw and from_raw appears in the same page high level pages, perhaps as “see also”, without having to manually insert them? It feels like it’s likely to be a semi-common pattern, so I’m thinking out loud here.

Otherwise, can I add a manual x-ref and submit the PR?