From 0cae31513b775261f8ac957637899ce2cc838bc8 Mon Sep 17 00:00:00 2001 From: Luke Gallagher Date: Fri, 24 Apr 2015 09:14:53 +1000 Subject: [PATCH] Add feature gate tests As part of the audit for #22820 the following feature gate tests have been added: * `rustc_diagnostic_macros` /cc #19624 --- .../feature-gate-rustc-diagnostic-macros.rs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/compile-fail/feature-gate-rustc-diagnostic-macros.rs diff --git a/src/test/compile-fail/feature-gate-rustc-diagnostic-macros.rs b/src/test/compile-fail/feature-gate-rustc-diagnostic-macros.rs new file mode 100644 index 0000000000000..8286d833e8d22 --- /dev/null +++ b/src/test/compile-fail/feature-gate-rustc-diagnostic-macros.rs @@ -0,0 +1,23 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that diagnostic macros are gated by `rustc_diagnostic_macros` feature +// gate + +__register_diagnostic!(E0001); +//~^ ERROR macro undefined: '__register_diagnostic!' + +fn main() { + __diagnostic_used!(E0001); + //~^ ERROR macro undefined: '__diagnostic_used!' +} + +__build_diagnostic_array!(DIAGNOSTICS); +//~^ ERROR macro undefined: '__build_diagnostic_array!'