Skip to content

Commit 1460787

Browse files
author
bors-servo
authored
Auto merge of #168 - KiChjang:diagnostic-drop, r=emilio
Implement Drop for Diagnostic I built it and ran the test, and they all pass. Not sure what else there is to test for. Fixes #145.
2 parents 3d87789 + 76f6496 commit 1460787

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/clang.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,9 +1047,11 @@ impl Diagnostic {
10471047
clang_getDiagnosticSeverity(self.x)
10481048
}
10491049
}
1050+
}
10501051

1052+
impl Drop for Diagnostic {
10511053
/// Destroy this diagnostic message.
1052-
pub fn dispose(&self) {
1054+
fn drop(&mut self) {
10531055
unsafe {
10541056
clang_disposeDiagnostic(self.x);
10551057
}

0 commit comments

Comments
 (0)