Skip to content
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

Document test restriction in placement #908

Open
Havvy opened this issue Nov 25, 2020 · 0 comments
Open

Document test restriction in placement #908

Havvy opened this issue Nov 25, 2020 · 0 comments

Comments

@Havvy
Copy link
Contributor

Havvy commented Nov 25, 2020

Thanks! The sentence above the example should probably be updated (The function will only be available while running tests.) and the function name (test_only) should also probably be changed.

I think it would also be a good idea to document this behavior somehow. AFAIK (rustc_builtin_macros), the only attributes this affects is test and bench. I don't know how soon rust-lang/rust#54726 might get stabilized, but if it might be a long time, maybe a brief mention at https://github.com/rust-lang/reference/blob/master/src/attributes/testing.md#the-test-attribute that says something along the lines of: "similar to proc-macros, the #[test] attribute only works as an [outer attribute], and cannot be used as an [inner attribute]".

Originally posted by @ehuss in #906 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant