diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2018-07-18 20:34:08 +0200 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2018-07-27 19:51:21 +0200 |
| commit | 71276c6abc5b7e0889db1f9e69e02eb5d2596f39 (patch) | |
| tree | 190d317f72be167b50eae66cc4563f50695a1628 /src/libsyntax_pos | |
| parent | b18b9edf006c10f4e08794d31425001401e27a09 (diff) | |
| download | rust-71276c6abc5b7e0889db1f9e69e02eb5d2596f39.tar.gz rust-71276c6abc5b7e0889db1f9e69e02eb5d2596f39.zip | |
Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributes
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index cc09a944e4c..a4d0bcd5c76 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -100,6 +100,8 @@ pub enum FileName { ProcMacroSourceCode, /// Strings provided as --cfg [cfgspec] stored in a crate_cfg CfgSpec, + /// Strings provided as crate attributes in the CLI + CliCrateAttr, /// Custom sources for explicit parser calls from plugins and drivers Custom(String), } @@ -115,6 +117,7 @@ impl std::fmt::Display for FileName { Anon => write!(fmt, "<anon>"), ProcMacroSourceCode => write!(fmt, "<proc-macro source code>"), CfgSpec => write!(fmt, "cfgspec"), + CliCrateAttr => write!(fmt, "<crate attribute>"), Custom(ref s) => write!(fmt, "<{}>", s), } } @@ -137,6 +140,7 @@ impl FileName { MacroExpansion | ProcMacroSourceCode | CfgSpec | + CliCrateAttr | Custom(_) | QuoteExpansion => false, } @@ -150,6 +154,7 @@ impl FileName { MacroExpansion | ProcMacroSourceCode | CfgSpec | + CliCrateAttr | Custom(_) | QuoteExpansion => false, Macros(_) => true, |
