Stream: general

Topic: rust_2018_macro


csmoe (Sep 28 2018 at 15:20, on Zulip):

how can I import macros from extern crate?

#![deny(rust_2018_idioms)]

// compiles
// #[macro_use]
// extern crate clap; // 2.32.0

use clap::app_from_crate; // err

fn main() {
  app_from_crate!();
}

https://play.rust-lang.org/?gist=076c1b34c67f6afb38eeefb32421b557&version=nightly&mode=debug&edition=2018

csmoe (Sep 28 2018 at 15:22, on Zulip):

and it's a bit strange that rustc won't errs even the deny enabled when comment use ... and uncomment #[macro_use] extern ...

Gabriel Majeri (Sep 28 2018 at 15:25, on Zulip):

use clap::*; does seem to work
I think the issue is with macro hygiene

Last update: Nov 22 2019 at 00:00UTC