mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
minor: Add some debug traces for cfg fetching
This commit is contained in:
parent
fcdced115e
commit
dbd5a70ea3
2 changed files with 43 additions and 26 deletions
|
@ -1,7 +1,7 @@
|
|||
//! Parsing of CfgFlags as command line arguments, as in
|
||||
//!
|
||||
//! rustc main.rs --cfg foo --cfg 'feature="bar"'
|
||||
use std::str::FromStr;
|
||||
use std::{fmt, str::FromStr};
|
||||
|
||||
use cfg::CfgOptions;
|
||||
|
||||
|
@ -48,3 +48,16 @@ impl Extend<CfgFlag> for CfgOptions {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CfgFlag {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
CfgFlag::Atom(atom) => f.write_str(atom),
|
||||
CfgFlag::KeyValue { key, value } => {
|
||||
f.write_str(key)?;
|
||||
f.write_str("=")?;
|
||||
f.write_str(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue