tidy check fix

This commit is contained in:
giacomo 2018-11-17 12:28:04 +01:00
parent 2b7c3fb725
commit 8e13e433c6
2 changed files with 19 additions and 10 deletions

View File

@ -1,19 +1,29 @@
// 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.
// #[test] attribute is not allowed on associated functions or methods
// reworded error message
// reworded error message
// compile-flags:--test
struct A {}
impl A {
#[test]
fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
A {}
}
#[test]
fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
A {}
}
}
#[test]
fn test() {
let _ = A::new();
let _ = A::new();
}
fn main() {}
fn main() {}

View File

@ -1,8 +1,7 @@
error: #[test] attribute is only allowed on non associated functions
--> $DIR/test-attr-non-associated-functions.rs:9:2
--> $DIR/test-attr-non-associated-functions.rs:19:5
|
LL | fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
| _____^
LL | / fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
LL | | A {}
LL | | }
| |_____^