Description
After upgrading to syn 0.14 (diff), activating the nightly feature breaks otherwise working code with a nonsensical error message.
cargo -V
: cargo 1.28.0-nightly (e2348c2db 2018-06-07)
rustc -V
: rustc 1.28.0-nightly (8afb89493 2018-06-08)
Setup for reproducing:
git clone https://github.com/konstin/capybara
cd capybara
git clone https://github.com/konstin/helix
cd helix
git checkout rebase1
cd ../tests
Without the nightly
feature, cargo rustc --features capybara/ruby
works just fine, but after activating that feature it in capybara-derive/Cargo.toml
(sed -i 's/version = "0.4"/version = "0.4", features = ["nightly"]/' ../capybara-derive/Cargo.toml
), the compilation fails with the following error:
error[E0423]: expected value, found module `helix`
--> tests/src/lib.rs:19:1
|
19 | #[capybara_bindgen]
| ^^^^^^^^^^^^^^^^^^^
| |
| `self` value is only available in methods with `self` parameter
| help: try: `self.helix`
error: aborting due to previous error
While there is a module (or rather a crate) helix
in scope, this error message is still nonsensical since helix
is always properly used as value (expanded code).
I'm not sure if this is a bug in the compiler, in proc-macro2, in syn or in quote, but since it needs the nightly
feature in proc-macro2, I'm reporting this here.