-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"#[test] attribute is only allowed on fn items" on fn struct method #55787
Comments
Rewording to something along the lines of "only allowed on bare fn items" (or another, more appropriate way to refer to functions) should be enough. |
I would like to help with that but I'm a first timer |
the string in question is on line 56 of rust/src/libsyntax_ext/test.rs. I would suggest changing it to '#[test] is only allowed on non-impl fn items". I have no idea what steps are involved in contributing this. |
I think '#[test] is only allowed on non associated functions' should be good, fn items inside impl are called associated functions or methods (if they have and instance of the struct to work with, i.e &self or &mut self) |
reword #[test] attribute error on fn items fix of [rust-lang#55787](rust-lang#55787) Reworded error message from "#[test] attribute is only allowed on fn items" to "#[test] attribute is only allowed on non associated functions"
Should this be closed @estebank ? |
warns however the
#[test]
in fact on afn
itemMaybe this could be made a bit more clear?
rustc 1.32.0-nightly (25a42b2ce 2018-11-07)
The text was updated successfully, but these errors were encountered: