jorendorff / cell-gc

A very small GC in Rust, with a safe API
MIT License
61 stars 4 forks source link

Fix dead_code warnings due to #[derive(IntoHeap)] #18

Closed jorendorff closed 7 years ago

jorendorff commented 7 years ago

There used to be a #[allow(dead_code)] attr on all methods generated by #[derive(IntoHeap)], to silence this kind of warning:

warning: method is never used: `set_car`
 --> toy_vm.rs:8:17
  |
8 | #[derive(Debug, IntoHeap)]
  |                 ^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

warning: method is never used: `set_cdr`
 --> toy_vm.rs:8:17
  |
8 | #[derive(Debug, IntoHeap)]
  |                 ^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

Not every field's setter is going to be used. In fact I think it's plausible to have fields that are never even got (GCLeaf fields used for their destructors)