fix errors/warnings from the stabilization of cfg_target_feature and target_feature (#432)

* fix build after stabilization of cfg_target_feature and target_feature

* fix doc tests

* fix spurious unused_attributes warning

* fix more unused attribute warnings

* More unnecessary target features

* Remove no longer needed trait imports

* Remove fixed upstream workarounds

* Fix parsing the #[assert_instr] macro

Following upstream proc_macro changes

* Fix form and parsing of #[simd_test]

* Don't use Cargo features for testing modes

Instead use RUSTFLAGS with `--cfg`. This'll help us be compatible with the
latest Cargo where a tweak to workspaces and features made the previous
invocations we had invalid.

* Don't thread RUSTFLAGS through docker

* Re-gate on x86 verification

Closes #411
This commit is contained in:
gnzlbg
2018-04-27 04:54:15 +02:00
committed by Alex Crichton
parent 189283e76f
commit 30962e58e6
62 changed files with 1135 additions and 1188 deletions

View File

@@ -25,31 +25,30 @@ pub fn simd_test(
let tokens = TokenStream::from(attr)
.into_iter()
.collect::<Vec<_>>();
if tokens.len() != 2 {
panic!("expected #[simd_test = \"feature\"]");
if tokens.len() != 3 {
panic!("expected #[simd_test(enable = \"feature\")]");
}
match &tokens[0] {
TokenTree::Op(tt) if tt.op() == '=' => {}
_ => panic!("expected #[simd_test = \"feature\"]"),
TokenTree::Term(tt) if tt.to_string() == "enable" => {}
_ => panic!("expected #[simd_test(enable = \"feature\")]"),
}
let target_features = match &tokens[1] {
match &tokens[1] {
TokenTree::Op(tt) if tt.op() == '=' => {}
_ => panic!("expected #[simd_test(enable = \"feature\")]"),
}
let enable_feature = match &tokens[2] {
TokenTree::Literal(tt) => tt.to_string(),
_ => panic!("expected #[simd_test = \"feature\"]"),
_ => panic!("expected #[simd_test(enable = \"feature\")]"),
};
let target_features: Vec<String> = target_features
.replace('"', "")
let enable_feature = enable_feature
.trim_left_matches('"')
.trim_right_matches('"');
let target_features: Vec<String> = enable_feature
.replace('+', "")
.split(',')
.map(|v| String::from(v))
.collect();
let enable_feature = match &tokens[1] {
TokenTree::Literal(tt) => tt.to_string(),
_ => panic!("expected #[simd_test = \"feature\"]"),
};
let enable_feature = enable_feature
.trim_left_matches('"')
.trim_right_matches('"');
let enable_feature = string(enable_feature);
let item = TokenStream::from(item);
let name = find_name(item.clone());