Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 3.35 KB

File metadata and controls

67 lines (54 loc) · 3.35 KB
category Build Utility
description Attributes to do conditional compilation based on rust version/channel

rustversion

Neat crate, but not as useful as you'd hope. In rustc 1.36, custom attributes cannot:

  • Be applied as inner attributes
  • Be applied to modules
  • Be applied to crates

Some tracking issues:

This has forced me to abandon for now:

version thoroughness understanding rating notes
1.0.0 high medium positive Full Review

1.0.0

file rating notes
src/attr.rs ✔️
src/bound.rs ✔️
src/date.rs ✔️ Custom parse impls
src/expr.rs ✔️ Custom keywords
src/lib.rs ✔️ Custom HTML docs, error handling
src/rustc.rs ✔️ Command [1]
src/time.rs Parsing date times seems a bit out-of-scope for this crate. OTOH, this is only used for an error message example by date.rs.
src/version.rs ✔️
.cargo_vcs_info.json ✔️
.cargo-ok ✔️
.gitignore ✔️
.travis.yml ✔️ Tests 1.31.0 (MSRV?), stable, beta, nightly
Cargo.lock ✔️ Recent-looking proc-macro2, quote, syn, unicode-xid
Cargo.toml ✔️ license = "MIT OR Apache-2.0"
Cargo.toml.orig ✔️ license = "MIT OR Apache-2.0"
LICENSE-APACHE ✔️ Skimmed
LICENSE-MIT ✔️
README.md ✔️ MIT OR Apache-2.0
Other Rating Notes
unsafe ✔️ None
fs ✔️ None
io ✔️ Command [1]
docs ✔️ Duplicated between readme and src/lib.rs
tests Could use more test coverage

Executes %RUSTC% --version. %RUSTC% is the only user controlled arg, and already set/read/executed by cargo. Baddies could simply modify %PATH% and do worse damage. LGTM! 👍

Other Takeaways

I really wish I had dived into this crate's src before doing my own proc macros. syn actually looks quite neato, I should probably replace my hand rolled logic in jni-glue-macros with it.

I should also consider testing with -Z minimal-versions (may require nightly currently?)