dtolnay / proc-macro-workshop

Learn to write Rust procedural macros  [Rust Latam conference, Montevideo Uruguay, March 2019]
Apache License 2.0
4k stars 1.01k forks source link

builder test 07: add advice about duplicate method names #27

Closed ericseppanen closed 4 years ago

ericseppanen commented 4 years ago

It's easy to miss the fact that the test case includes a field named "env" and a #[builder(each = "env")] attribute.

This will cause a "duplicate definitions with name 'env'" error if the macro produces two methods.

Hopefully addresses #26 . Feel free to tweak the language.