Give a more descriptive error when marking non-test items as #[test]

Closes #14772.
This commit is contained in:
P1start 2014-10-05 12:27:42 +13:00
parent a29df44f51
commit cc31d9cabc
2 changed files with 41 additions and 12 deletions

View file

@ -0,0 +1,16 @@
// Copyright 2014 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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: --test
#[test]
mod foo {} //~ ERROR only functions may be used as tests
fn main() {}