Manishearth / rust-gc

Simple tracing (mark and sweep) garbage collector for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove feature(specialization)

andersk opened this issue · comments

Building gc with the nightly crate feature produces this scary warning because feature(specialization) is known to be unsound (see rust-lang/rust#31844).

warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
 --> gc/src/lib.rs:9:50
  |
9 |     feature(coerce_unsized, auto_traits, unsize, specialization)
  |                                                  ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
  = help: consider using `min_specialization` instead, which is more stable and complete

Furthermore, enabling specialization for Trace forces any downstream crate that uses #[derive(Trace)] to itself enable feature(specialization). This makes turning on the nightly feature a backwards-incompatible change that violates additivity of features, and will cause compilation problems under feature unification.

Our use case for specialization is to save the user from typing #[derive(Finalize, Trace)] instead of #[derive(Trace)], but that doesn’t seem like sufficient justification for using an unsound feature. So I think we should remove specialization completely.

This seems okay to me, @mystor ?