Skip to content

Commit

Permalink
Make the debug output for TargetSelection less verbose
Browse files Browse the repository at this point in the history
In particular, this makes the output of `x build -vv` easier to read.
Before:

```
    c Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
```

After:
```
    c Sysroot { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu } }
```
  • Loading branch information
jyn514 committed Apr 16, 2022
1 parent bb1a03c commit 82d99ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl FromStr for LlvmLibunwind {
}
}

#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TargetSelection {
pub triple: Interned<String>,
file: Option<Interned<String>>,
Expand Down Expand Up @@ -276,6 +276,12 @@ impl fmt::Display for TargetSelection {
}
}

impl fmt::Debug for TargetSelection {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self)
}
}

impl PartialEq<&str> for TargetSelection {
fn eq(&self, other: &&str) -> bool {
self.triple == *other
Expand Down

0 comments on commit 82d99ad

Please sign in to comment.