summaryrefslogtreecommitdiff
path: root/src/clang.rs
diff options
context:
space:
mode:
authorDavid Drysdale <drysdale@google.com>2021-11-26 01:42:47 +0000
committerGitHub <noreply@github.com>2021-11-26 02:42:47 +0100
commit7bd23291e29e1874f57a628e94d7632b3b367ae6 (patch)
treea7381f98e6fb46c2020bccb344e98ba0e38523ab /src/clang.rs
parent04f5c0715832feee6c059128cd5cd70056e861f7 (diff)
Add --blocklist-file option (#2097)
Update Item to hold a `clang::SourceLocation` and use this to allow blocklisting based on filename. The existing code has a special case that always maps <stdint.h> integer types to corresponding Rust integer types, even if the C types are blocklisted. To match this special case behaviour, also treat these C <stdint.h> types as being eligible for derived Copy/Clone/Debug traits. Fixes #2096
Diffstat (limited to 'src/clang.rs')
-rw-r--r--src/clang.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 36ccd266..074d459b 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -1401,6 +1401,12 @@ impl fmt::Display for SourceLocation {
}
}
+impl fmt::Debug for SourceLocation {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "{}", self)
+ }
+}
+
/// A comment in the source text.
///
/// Comments are sort of parsed by Clang, and have a tree structure.