I’m using the nightly compiler from about a month back (I suppose that shouldn’t make a difference). When I run cargo build, it successfully builds but when I run cargo test it fails with can't find crate for the plex crate.

I ran it with verbose and the problem seems to be with running doc-tests, it says:

Hard to tell what’s going on here. Your crate looks fine (the duplicate entry of plex under dev-dependencies is redundant though, as is the caret), and the issue sounds very unusual.

I can’t reproduce it without the Cargo.lock, because a breaking change in unstable feature names took place very recently and some—but not all—dependencies have updated. (If I use the current nightly, plex-0.2.2 can’t build because it does not use the new feature names. If I use the same toolchain as you, proc_macro2-0.4.8 can’t build because it did update to use the new feature names)

Hi, thanks for trying I looked at the manifest format in the cargo book and it wasn’t clear what was needed so I just made something that compiled.

I can’t reproduce it without the Cargo.lock, because a breaking change in unstable feature names took place very recently and some—but not all—dependencies have updated

Ah, I see. I’ve updated the repo with the lock file in case it is helpful.

plex-0.2.2 can’t build because it does not use the new feature names

Is using the new feature names mandatory or an opt-in thing? I don’t quite understand and search “feature names rust-lang nightly” doesn’t turn up anything useful … could you suggest some place where I can read up on it? Is it something that I should be concerned about going forward if I continue using nightly?

It isn’t so much feature names you have to worry about, but rather just features in general..

My advice is: Unless you are writing throwaway code, avoid nightly-only crates unless they are heavily maintained.. Your safest bet is to look for ones that are very popular (as they couldn’t be popular if they don’t work!)

The key term to look up is unstable features. Unstable features are the opt-in unstable parts of rust only available on nightly (e.g. because they are not fully implemented, or they might change, etc.). There’s a short intro here: https://doc.rust-lang.org/unstable-book/index.html

I’ll reproduce their example here:

#![feature(box_syntax)]
fn main() {
let five = box 5;
}

In this example, box_syntax is what I referred to as the feature name. (the official term is actually feature flag)

The trouble with using unstable features is that, well… they change! You’ve forfeited the stability guarantees of rust. An argument might be added to a method; a function might get renamed or moved to another module; and, as witnessed here, even the feature flag may be renamed… and any one of these changes create deadly fissures in the nightly-only ecosystem until everybody updates their code.