Pre-RFC: stabilization of target_feature

@alexcrichton and I talked a bit about my issue above on IRC in #rust-libs. Basically, there are two fundamental problems with #[target_feature]:

  1. It can lead to SIGILL (or equivalent).
  2. It can lead to ABI mismatches between function calls. And in particular, this doesn’t seem discoverable until monomorphization time.

With respect to (1), there doesn’t seem to be much we can do. I think we can probably assume that executing an unknown instruction will result in sane behavior like your program aborting (although this isn’t obviously 100% correct to me, since it seems like a platform specific thing).

With respect to (2), it seems a bit trickier to handle, but @alexcrichton thinks it’s possible to detect ABI mismatches during monomorphization. In particular, we could start by reporting a hard error, but it also seems possible to resolve the ABI mismatch by inserting shims. The error at monomorphization time seems unfortunate, but it’s not quite clear what other path we could take.