Skip to content

1.2. Add Reference to dead_code #1662

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

Closed
LingkKang opened this issue Jan 7, 2023 · 0 comments
Closed

1.2. Add Reference to dead_code #1662

LingkKang opened this issue Jan 7, 2023 · 0 comments

Comments

@LingkKang
Copy link
Contributor

I think add a little explanation of this #[allow(dead_code)] could be better. One line is enough.

#[allow(dead_code)]
struct Structure(i32);
// This will not compile because `Structure` does not implement
// fmt::Display.
//println!("This struct `{}` won't print...", Structure(3));
// TODO ^ Try uncommenting this line

Firstly, I'm a little bit confused by it, and then I googled. The first link redirected me to dead_code - Rust By Example.

Since it would be covered later in RBE, why don't mention it and give a reference link? Just like giving out a link of macro in Hello World - Rust By Example.

This could make life much easier for beginners.

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

2 participants