Closed
Description
Upgrading Servo to today’s Nightly caused a confusing pair of error messages:
error[E0432]: unresolved import `dom_struct::dom_struct`
--> components/script/dom/htmlulistelement.rs:10:5
|
10 | use dom_struct::dom_struct;
| ^^^^^^^^^^^^^^^^^^^^^^ no `dom_struct` in the root
error[E0658]: The attribute `dom_struct` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
--> components/script/dom/bluetoothpermissionresult.rs:26:1
|
26 | #[dom_struct]
| ^^^^^^^^^^^^^
|
= help: add #![feature(custom_attribute)] to the crate attributes to enable
Adding #[macro_use]
changes the second error to:
error[E0658]: attribute procedural macros are experimental (see issue #38356)
--> components/script/dom/attr.rs:28:1
|
28 | #[dom_struct]
| ^^^^^^^^^^^^^
|
::: components/script/lib.rs:35:1
|
35 | #[macro_use] extern crate dom_struct;
| ------------ procedural macro imported here
|
= help: add #![feature(proc_macro)] to the crate attributes to enable
All three messages are wrong:
dom_struct::dom_struct
does existfeature(custom_attribute)
is not the correct fixfeature(proc_macro)
is not only not the correct fix, it was already present!
The correct fix is to add #![feature(use_extern_macros)]
, but the only way to figure that out is to read #52081.