add test for #28134

This commit is contained in:
Andy Russell 2018-10-04 15:49:29 -04:00
parent 6ddab3e078
commit 1ab1b1e6f8
No known key found for this signature in database
GPG Key ID: BE2221033EDBC374
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// Copyright 2018 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] //~ ERROR only functions may be used as tests

View File

@ -0,0 +1,8 @@
error: only functions may be used as tests
--> $DIR/issue-28134.rs:13:1
|
LL | #![test] //~ ERROR only functions may be used as tests
| ^^^^^^^^
error: aborting due to previous error