rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.66k stars 12.63k forks source link

Suggested fix for E0658 does not resolve the compiler error #50459

Open VictorKoenders opened 6 years ago

VictorKoenders commented 6 years ago

A little while back I've released my bitrange crate.

On rustc 1.27.0-nightly (ac3c2288f 2018-04-18), this works like a charm.

On rustc 1.27.0-nightly (91db9dcf3 2018-05-04), I get the following error:

error[E0658]: procedural macros cannot be expanded to expressions
...
   = help: add #![feature(proc_macro_non_items)] to the crate attributes to enable
   = note: this error originates in a macro outside of the current crate (in Nightuilds, run with -Z external-macro-backtrace for more info)

I've tried adding the suggested #![feature(proc_macro_non_items)] to the following items, but the error is not resolved:

I've added the suggested fixes to this branch. (run cargo test to trigger the errors)

jgarvin commented 5 years ago

not sure if this should be considered the same issue or a different issue, but I get the same error number with a completely different error message, which seems to defeat the point of having easy to Google error numbers:

error[E0658]: imports can only refer to extern crate names passed with--externon stable channel (see issue #53130)

RandomInsano commented 5 years ago

FWIW, I have another:

error[E0658]: unions with non-`Copy` fields are unstable (see issue #32836)

Leirda01 commented 4 years ago

This is why you don't get the same error code message: https://doc.rust-lang.org/error-index.html#E0658 I think you should also consider adding #![repr(proc_macro_non_items)] before any expression in which you need the feature, like explained in the above link.