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 the file! macro #11674

Merged
merged 1 commit into from
Jan 21, 2014
Merged

document the file! macro #11674

merged 1 commit into from
Jan 21, 2014

Conversation

indirect
Copy link
Contributor

Found out about file! today from o11c in IRC.

@alexcrichton
Copy link
Member

Hm, there seem to be a number of things wrong with this section in the documentation. Notable the fmt! macro doesn't exist and the env! macro has undocumented semantics. Additionally, this is missing a lot of macros defined by the compiler.

With bors's queue so full right now, I would rather take the time to fix this properly rather than just inching it forward a little bit.

What do you think about this? I'd almost think that this section should get removed because there's no way for it to stay up to date.

@huonw
Copy link
Member

huonw commented Jan 20, 2014

I'd almost think that this section should get removed because there's no way for it to stay up to date.

I disagree, we don't change/remove the functionality of macros that often; we may add things, but leaving only new ones undocumented is better than having everything undocumented.

@indirect
Copy link
Contributor Author

I think that as Rust settles down heading in to 1.0 it will be even easier to keep the list updated, and I would much rather have imperfect documentation than no documentation. :)

@indirect
Copy link
Contributor Author

Maybe off-topic, but can't bors merge documentation without having to build everything on every platform? If not, that seems like a really big obstacle for documenting rust in the official docs rather than other github repos that can easily accept patches.

@huonw
Copy link
Member

huonw commented Jan 20, 2014

We test examples in documentation to make sure they are compilable.

(I know this one doesn't touch any examples, but running everything through the bots helps reduce the chance of a mistake on the part of the reviewer.)

@olsonjeffery
Copy link
Contributor

Dovetailing on the "We test examples in documentation" thing, I'd love to set up a stub module in libstd that just contains documentation and examples for the various compiler macros. I think we can do better than a bullet-point list in the reference manual.

@olsonjeffery
Copy link
Contributor

(and yes, I'm offering to do the work in another PR, provided there's buy-in that this is a tenable approach)

@indirect
Copy link
Contributor Author

@huonw how is that possible given e.g. #11693?

@olsonjeffery I was thinking of just expanding the Macro section in the manual to include sections and documentation for each macro, actual API documentation sounds better to me for sure.

@huonw
Copy link
Member

huonw commented Jan 21, 2014

@indirect as Alex says on that PR, it's correct on master.

bors added a commit that referenced this pull request Jan 21, 2014
Found out about `file!` today from o11c in IRC.
@bors bors closed this Jan 21, 2014
@bors bors merged commit ec2b8c5 into rust-lang:master Jan 21, 2014
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.

5 participants