Skip to content

Commit ce0ae76

Browse files
authored
Disallow constant values that were changed in clang 15 (#2410)
* Disallow constant values that could cause problems with clang 15 * Fix clippy warnings
1 parent 01c4539 commit ce0ae76

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

bindgen/codegen/serialize.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ impl<'a> CSerialize<'a> for Item {
4444
ItemKind::Function(func) => {
4545
func.serialize(ctx, self, stack, writer)
4646
}
47-
kind => {
48-
return Err(CodegenError::Serialize {
49-
msg: format!("Cannot serialize item kind {:?}", kind),
50-
loc: get_loc(self),
51-
});
52-
}
47+
kind => Err(CodegenError::Serialize {
48+
msg: format!("Cannot serialize item kind {:?}", kind),
49+
loc: get_loc(self),
50+
}),
5351
}
5452
}
5553
}

bindgen/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//! additional documentation.
1010
#![deny(missing_docs)]
1111
#![deny(unused_extern_crates)]
12+
#![deny(clippy::disallowed_methods)]
1213
// To avoid rather annoying warnings when matching with CXCursor_xxx as a
1314
// constant.
1415
#![allow(non_upper_case_globals)]

clippy.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
disallowed-methods = [
2+
{ path = "clang_sys::CXCursor_TranslationUnit", reason = "This value was changed in clang 15"},
3+
{ path = "clang_sys::CXCursor_LastStmt", reason = "This value was changed in clang 15"}
4+
]

0 commit comments

Comments
 (0)