Skip to content

1.2. Add Reference to dead_code #1662

Closed
@LingkKang

Description

@LingkKang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions