From c4bcf7714b1aa3dbf335cc4de6a1017e8dde3680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=CC=81o=20Testard?= Date: Tue, 22 Oct 2013 01:18:57 +0200 Subject: [PATCH] Activate checking code for ASM feature gate. Fix tests --- src/librustc/front/feature_gate.rs | 7 ++----- src/libstd/std.rs | 2 +- src/test/compile-fail/asm-gated.rs | 2 -- src/test/compile-fail/asm-in-bad-modifier.rs | 3 +++ src/test/compile-fail/asm-out-assign-imm.rs | 3 +++ src/test/compile-fail/asm-out-no-modifier.rs | 3 +++ src/test/compile-fail/asm-out-read-uninit.rs | 3 +++ src/test/pretty/raw-str-nonexpr.rs | 3 +++ src/test/run-pass/asm-out-assign.rs | 3 +++ 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs index 0f1d527163d..0f8307b87e5 100644 --- a/src/librustc/front/feature_gate.rs +++ b/src/librustc/front/feature_gate.rs @@ -124,11 +124,8 @@ impl Visitor<()> for Context { } else if path.segments.last().identifier == self.sess.ident_of("asm") { - // NOTE: remove the false once the ASM feature is in the next snapshot - if false { - self.gate_feature("asm", path.span, "inline assembly is not \ - stable enough for use and is subject to change"); - } + self.gate_feature("asm", path.span, "inline assembly is not \ + stable enough for use and is subject to change"); } } diff --git a/src/libstd/std.rs b/src/libstd/std.rs index c446fe3d94f..c27609a590a 100644 --- a/src/libstd/std.rs +++ b/src/libstd/std.rs @@ -61,7 +61,7 @@ they contained the following prologue: html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")]; -#[feature(macro_rules, globs)]; +#[feature(macro_rules, globs, asm)]; // Don't link to std. We are std. #[no_std]; diff --git a/src/test/compile-fail/asm-gated.rs b/src/test/compile-fail/asm-gated.rs index 47f1574273b..8d053bdae78 100644 --- a/src/test/compile-fail/asm-gated.rs +++ b/src/test/compile-fail/asm-gated.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// xfail-test - fn main() { unsafe { asm!(""); //~ ERROR inline assembly is not stable enough diff --git a/src/test/compile-fail/asm-in-bad-modifier.rs b/src/test/compile-fail/asm-in-bad-modifier.rs index 442536b1e29..87d03290b46 100644 --- a/src/test/compile-fail/asm-in-bad-modifier.rs +++ b/src/test/compile-fail/asm-in-bad-modifier.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// xfail-fast #[feature] doesn't work with check-fast +#[feature(asm)]; + fn foo(x: int) { info2!("{}", x); } #[cfg(target_arch = "x86")] diff --git a/src/test/compile-fail/asm-out-assign-imm.rs b/src/test/compile-fail/asm-out-assign-imm.rs index 6709e803d88..629d8082f44 100644 --- a/src/test/compile-fail/asm-out-assign-imm.rs +++ b/src/test/compile-fail/asm-out-assign-imm.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// xfail-fast #[feature] doesn't work with check-fast +#[feature(asm)]; + fn foo(x: int) { info2!("{}", x); } #[cfg(target_arch = "x86")] diff --git a/src/test/compile-fail/asm-out-no-modifier.rs b/src/test/compile-fail/asm-out-no-modifier.rs index 9ddb0d529d4..80237f331bc 100644 --- a/src/test/compile-fail/asm-out-no-modifier.rs +++ b/src/test/compile-fail/asm-out-no-modifier.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// xfail-fast #[feature] doesn't work with check-fast +#[feature(asm)]; + fn foo(x: int) { info2!("{}", x); } #[cfg(target_arch = "x86")] diff --git a/src/test/compile-fail/asm-out-read-uninit.rs b/src/test/compile-fail/asm-out-read-uninit.rs index 9a3701511e3..ce3bbcebec2 100644 --- a/src/test/compile-fail/asm-out-read-uninit.rs +++ b/src/test/compile-fail/asm-out-read-uninit.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// xfail-fast #[feature] doesn't work with check-fast +#[feature(asm)]; + fn foo(x: int) { info2!("{}", x); } #[cfg(target_arch = "x86")] diff --git a/src/test/pretty/raw-str-nonexpr.rs b/src/test/pretty/raw-str-nonexpr.rs index d7960a7ea80..2bb1fadf87d 100644 --- a/src/test/pretty/raw-str-nonexpr.rs +++ b/src/test/pretty/raw-str-nonexpr.rs @@ -8,8 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// xfail-fast #[feature] doesn't work with check-fast // pp-exact +#[feature(asm)]; + #[cfg = r#"just parse this"#] extern mod blah = r##"blah"##; diff --git a/src/test/run-pass/asm-out-assign.rs b/src/test/run-pass/asm-out-assign.rs index 2e1fc65d2ba..cbefe39c50f 100644 --- a/src/test/run-pass/asm-out-assign.rs +++ b/src/test/run-pass/asm-out-assign.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// xfail-fast #[feature] doesn't work with check-fast +#[feature(asm)]; + #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")] pub fn main() {