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

libcore documentation for builtin macros #37325

Merged
merged 3 commits into from
Oct 23, 2016
Merged

libcore documentation for builtin macros #37325

merged 3 commits into from
Oct 23, 2016

Conversation

newpavlov
Copy link
Contributor

@newpavlov newpavlov commented Oct 21, 2016

Fixes: #36272

Additionally I've edited docstring for include! a bit. (related PR #36404)

Unfortunately it seems there is no sane way to reexport empty macros definitions for their docstrings. To avoid copying the whole documentation for builtin macros I've only copied description and added links to std macro pages.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@steveklabnik
Copy link
Member

@bors: delegate=frewsxcv

@bors
Copy link
Contributor

bors commented Oct 21, 2016

✌️ @frewsxcv can now approve this pull request

@frewsxcv
Copy link
Member

Is it not possible to move the macros currently in std from std to core and add them to this attribute?

@newpavlov
Copy link
Contributor Author

I mentioned it in the OP. Naively moving mod builtin to libcore and adding reexports will result in reexported macro not found error. I've tried to play around with #[cfg_attr(dox, macro_reexport(...))] but without any results.

I am unable to fully analyze why this error happens, but my guess is what when we trying to compile docs and use extern crate core we compile libcore without dox option. Probably it can be fixed by modification of makefile or by using some another way, but it will require more in-depth knowledge which I do not currently posses.

@newpavlov
Copy link
Contributor Author

If you want to try to fix reexported macro not found error you can look at this branch.

@frewsxcv
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 22, 2016

📌 Commit 34576da has been approved by frewsxcv

@bors
Copy link
Contributor

bors commented Oct 23, 2016

⌛ Testing commit 34576da with merge 87af232...

bors added a commit that referenced this pull request Oct 23, 2016
libcore documentation for builtin macros

Fixes: #36272

Additionally I've edited docstring for `include!` a bit. (related PR #36404)

Unfortunately it seems there is no sane way to reexport empty macros definitions for their docstrings. To avoid copying the whole documentation for builtin macros I've only copied description and added links to `std` macro pages.
@bors bors merged commit 34576da into rust-lang:master Oct 23, 2016
@eddyb
Copy link
Member

eddyb commented Nov 11, 2016

Sadly this broke cross-crate [src] links in rustdoc (which is already a crumbling pile of hacks).
What's happening is that this introduces exactly one new item (the mod) which is not present when libcore is build regularly, and that determines what DefIds compiling libstd sees.
The difference of 1 in the DefId (or rather, DefIndex) between documented libcore and imported-by-libstd libcore shows up in the cross-crate [src] links, which assumes identical libcores.

Simplest fix would be to just remove the mod and apply the #[cfg(dox)] to each macro instead.
cc @rust-lang/tools

@newpavlov
Copy link
Contributor Author

@eddyb
So I need to remove mod builtin from libcore and instead use #[cfg(dox)] on each builtin macros, is it right? Should I create another pull request for it?

@eddyb
Copy link
Member

eddyb commented Nov 12, 2016

@newpav Sorry it didn't get linked. There's already a fix up, #37727.

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

Successfully merging this pull request may close these issues.

7 participants