Skip to content

Commit

Permalink
Merge pull request #532 from Alexander-N/gc-default
Browse files Browse the repository at this point in the history
Remove default implementation for PyGCProtocol
  • Loading branch information
konstin authored Jul 15, 2019
2 parents 7e4b716 + 9c961b4 commit 5ae014f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/class/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ use std::os::raw::{c_int, c_void};
pub struct PyTraverseError(c_int);

/// GC support
#[allow(unused_variables)]
pub trait PyGCProtocol<'p>: PyTypeInfo {
fn __traverse__(&'p self, visit: PyVisit) -> Result<(), PyTraverseError> {
unimplemented!()
}

fn __clear__(&'p mut self) {
unimplemented!()
}
fn __traverse__(&'p self, visit: PyVisit) -> Result<(), PyTraverseError>;
fn __clear__(&'p mut self);
}

pub trait PyGCTraverseProtocol<'p>: PyGCProtocol<'p> {}
Expand Down
1 change: 1 addition & 0 deletions tests/test_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ impl PyGCProtocol for GCIntegration2 {
fn __traverse__(&self, _visit: PyVisit) -> Result<(), PyTraverseError> {
Ok(())
}
fn __clear__(&mut self) {}
}

#[test]
Expand Down

0 comments on commit 5ae014f

Please sign in to comment.