mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
tidy check fix
This commit is contained in:
parent
2b7c3fb725
commit
8e13e433c6
@ -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() {}
|
||||
|
@ -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 | | }
|
||||
| |_____^
|
||||
|
Loading…
Reference in New Issue
Block a user