Need comprehensive story for target_feature compat (original) (raw)

From #138872 per Amanieu:

I do think we need a more general mechanism to indicate that 2 target features are mutually incompatible. For example:

Currently nothing stops you from enabling incompatible features with #[target_feature] and -C target-feature, which will crash LLVM.

We should be emitting an error way before anything gets to LLVM because we have to have a better idea of what features are actually compatible. We effectively need to have both global and local notions of it.