On https://lib.rs I'd like to add compatibility badges for
Futures-using crates, classifying them as either 0.1-compatible or std-compatible, so that users of either ecosystem don't run into unexpected incompatibilities.
However, I wonder what would be the most reliable (and reasonably easy to implement) way of detecting whether a crate is a "std" or "0.1" compatible?
futures 0.1dependency seems easiest, but it's not guaranteed to be accurate. A crate may use it only internally and not expose it as a public interface. Or it can use it to provide a compatibility shim and support both 0.1 and std.
I could search code for "
std::future" and assume this means the crate is for the new futures. I could maybe use rls/save-analysis to make it more precise.
Asking authors to add badges/metadata is out, since I'd like this to work with all relevant crates.
Any other ideas?