-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
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)
heyyong
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.