Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dyn could be explained better #183

Closed
knocte opened this issue Jul 10, 2019 · 6 comments
Closed

dyn could be explained better #183

knocte opened this issue Jul 10, 2019 · 6 comments

Comments

@knocte
Copy link

knocte commented Jul 10, 2019

There are two issues with this page: https://doc.rust-lang.org/edition-guide/rust-2018/trait-system/dyn-trait-for-trait-objects.html

It doesn't explain where does "dyn" come from, is it from the word "dynamic"? It should mention dynamic dispatching AFAIU.
It's targeted to people that are already familiar with Rust (that is, the people that were already using Rust before dyn keyword existed). If a new developer comes, it's better to just talk about the new way of doing things, not just mentioning that dyn is some new way to do some old stuff.

@Centril
Copy link
Contributor

Centril commented Jul 10, 2019

It doesn't explain where does "dyn" come from, is it from the word "dynamic"? It should mention dynamic dispatching AFAIU.

Sure, a small note along with a link to the book would be good. I'd be happy to review such a PR.

It's targeted to people that are already familiar with Rust (that is, the people that were already using Rust before dyn keyword existed).

This is the intended target audience of the edition guide.

If a new developer comes, it's better to just talk about the new way of doing things, not just mentioning that dyn is some new way to do some old stuff.

Seems like a better fit for the book.

@knocte
Copy link
Author

knocte commented Jul 10, 2019

This is the intended target audience of the edition guide.

I was sent here from rust-lang/docs.rs#374 , I guess I should reopen that one to have dyn docs that are not just related to editions?

Seems like a better fit for the book.

What book? I found this issue by googling for "dyn rust" and not finding proper docs for a rust newbie.

@Centril
Copy link
Contributor

Centril commented Jul 10, 2019

What book? I found this issue by googling for "dyn rust" and not finding proper docs for a rust newbie.

The Rust Programming Language

I was sent here from rust-lang/docs.rs#374 , I guess I should reopen that one to have dyn docs that are not just related to editions?

The issue tracker for docs.rs (which collects docs about crates.io crates) is not the right place.

@knocte
Copy link
Author

knocte commented Jul 10, 2019

The issue tracker for docs.rs (which collects docs about crates.io crates) is not the right place.

Holy cow this is a bit confusing. I'd suggest to rename docs.rs to cratedocs.rs, I don't know.

The Rust Programming Language

So I open the issue there yeah? Yet another bounce :)

@Centril
Copy link
Contributor

Centril commented Jul 10, 2019

So I open the issue there yeah? Yet another bounce :)

I'd still be open to improvements here as well. ^^

@ehuss
Copy link
Contributor

ehuss commented May 25, 2021

Closing per #232, this section has been removed. Sorry about getting bounced around, it can be confusing, and perhaps the edition guide didn't make its intended audience clear.

Trait objects (and the dyn syntax) is usually first introduced in the book (https://doc.rust-lang.org/book/ch17-02-trait-objects.html) which discusses that it is used for dynamic dispatch.

@ehuss ehuss closed this as completed May 25, 2021
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

No branches or pull requests

3 participants