This program on a 32 bit Linux outputs no SSE :( even though our default target does enable SSE and SSE2:
#![feature(cfg_target_feature)]
#[cfg(target_feature="sse")]
fn main() {
println!("yay, SSE!");
}
#[cfg(not(target_feature="sse"))]
fn main() {
println!("no SSE :(");
}
I'll save myself the hassle of copying rustc -vV from the VM I tested this on, because the relevant code hasn't been touched since cfg_target_feature was introduced in 4f44258 (July 2015).
This is because the feature detection is really naive, neither asking LLVM for details nor even looking at rustc's own target definitions. @huonw mentioned this in #27731 (comment) but IMHO this deserves an issue of its own.