mutagen
mutagen copied to clipboard
error[E0557]: feature has been removed
When I try to run cargo +nightly test
, I get a whole slew of errors:
error[E0557]: feature has been removed
--> /home/joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/mutagen-plugin-0.1.2/src/lib.rs:1:30
|
1 | #![feature(plugin_registrar, quote, rustc_private, custom_attribute)]
| ^^^^^ feature has been removed
error[E0432]: unresolved imports `syntax::fold`, `syntax::fold`
--> /home/joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/mutagen-plugin-0.1.2/src/lib.rs:23:20
|
23 | use syntax::fold::{self, Folder, ExpectOne};
| ^^^^ ^^^^ no `fold` in the root
| |
| could not find `fold` in `syntax`
error: cannot find macro `quote_expr!` in this scope
--> /home/joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/mutagen-plugin-0.1.2/src/lib.rs:431:42
|
431 | let mut mut_expression = quote_expr!(self.cx(), $lit);
| ^^^^^^^^^^
...
error[E0412]: cannot find type `TypeBinding` in this scope
--> /home/joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/mutagen-plugin-0.1.2/src/lib.rs:1240:26
|
1240 | fn ty_bindings_equal(a: &TypeBinding, b: &TypeBinding, inout: bool) -> bool {
| ^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `TypeBinding` in this scope
--> /home/joshua/.cargo/registry/src/github.com-1ecc6299db9ec823/mutagen-plugin-0.1.2/src/lib.rs:1240:43
|
1240 | fn ty_bindings_equal(a: &TypeBinding, b: &TypeBinding, inout: bool) -> bool {
| ^^^^^^^^^^^ not found in this scope
error: aborting due to 48 previous errors
Some errors have detailed explanations: E0412, E0432, E0557.
For more information about an error, try `rustc --explain E0412`.
error: Could not compile `mutagen-plugin`.
cargo +nightly --version
: cargo 1.37.0-nightly (545f35425 2019-05-23)
rustup run nightly rustc --version
: rustc 1.37.0-nightly (d132f544f 2019-06-07)
mutagen-plugin
version: v0.1.2
My code in src/main.rs
:
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(mutagen_plugin))]
#![feature(custom_attribute)]
#[cfg(test)]
extern crate mutagen;
pub mod lex;
// more code follows
My code in src/lex.rs
:
#[cfg_attr(test, mutate)]
// lots of code
~~Hmm, I cloned the repo and ran cargo +nightly build
and it works fine from there. Not sure why it behaves different when used in a library.~~ I was compiling mutagen
, not mutagen-plugin
. The plugin shows the same errors.
https://stackoverflow.com/questions/25561137/how-to-write-a-custom-attribute-that-injects-code-into-a-function#25563608 suggests using the syntax
crate instead, not sure if that's a workable solution.
I have an unfinished rewrite using the syn
and quote
crates, but stopped working on it due to some architectural discussions with @power-fungus that have not yet been resolved. Guess I should resume working on it.