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

rustdoc --test fails for simple examples in macro doc-comments. #23571

Closed
insaneinside opened this issue Mar 20, 2015 · 2 comments · Fixed by #23618 or #23619
Closed

rustdoc --test fails for simple examples in macro doc-comments. #23571

insaneinside opened this issue Mar 20, 2015 · 2 comments · Fixed by #23618 or #23619

Comments

@insaneinside
Copy link
Contributor

This gist contains a short, sweet, and simple reduced case.

@bstrie
Copy link
Contributor

bstrie commented Mar 21, 2015

This is really a documentation bug. First, we need to document that you have to explicitly link your macros when writing doctests for them. Second, because linking can only be done at a crate root and because rustdoc will implicitly wrap your test in a main, you have to encapsulate your tests in your own main in order to disable this.

@bstrie
Copy link
Contributor

bstrie commented Mar 21, 2015

Here's how the original gist looks when updated with the changes described above: https://gist.github.com/bstrie/653bc834aa871b8f45fa

Doubly misleading is that it's no use reading the stdlib when trying to figure out the cause of this test failure, because the implict linking of the std macros masks the need for manual linking.

@bstrie bstrie added the A-docs label Mar 21, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Mar 22, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Mar 22, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this issue Mar 23, 2015
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 23, 2015
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 23, 2015
Fixes rust-lang#23571

I _think_ this is better, but other suggestions welcome too.
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 24, 2015
Fixes rust-lang#23571 

I _think_ this is better, but other suggestions welcome too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants