Pass command line flags to compiler plugin?


Is there any way for a compiler plugin to access flags passed to rustc? Better yet, is there a way for it to define its own flags that won’t cause rustc to error out on an unrecognized flag?


Beyond feature flags, I think your next best bet is the environment, either with env!("name") or std::env::var("name") depending on when you need to read it. (I’m not sure for a plugin…)


Oh that’s not a bad idea! Thanks!