Closed
Description
#![feature(test)]
extern crate test;
struct A {}
impl A {
#[test]
fn new() -> A {
A {}
}
}
#[test]
fn test() {
let _ = A::new();
}
fn main() {}
warns however the #[test]
in fact on a fn
item
error: #[test] attribute is only allowed on fn items
--> src/main.rs:8:2
|
8 | fn new() -> A {
| _____^
9 | | A {}
10 | | }
| |_____^
Maybe this could be made a bit more clear?
rustc 1.32.0-nightly (25a42b2ce 2018-11-07)