book icon indicating copy to clipboard operation
book copied to clipboard

Add hello_macro_derive to hello_macro dependencies ch19-06

Open kimpham54 opened this issue 2 years ago • 1 comments
trafficstars

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:

    • hello macro derive
    • macro dependencies
    • macro derive
  • I have checked the latest main branch to see if this has already been fixed, in this file:

    • https://github.com/rust-lang/book/blob/main/src/ch19-06-macros.md

URL to the section(s) of the book with this problem:

  • https://doc.rust-lang.org/book/ch19-06-macros.html

Description of the problem:

  • hello_world_macro should be added to dependencies in hello_macro/Cargo.toml in order to import it into main.rs

Suggested fix: A description to add the line in Cargo.toml dependencies of hello_macro/Cargo.toml:

[dependencies]
hello-world-derive = { path = "hello-world-derive" }

kimpham54 avatar Apr 26 '23 13:04 kimpham54

You are correct! I think at this point in the book most people realize they need to add dependencies for things to work, but we might still want to be explicit about this. Flagging it up as a thing to consider!

chriskrycho avatar Apr 05 '24 18:04 chriskrycho