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: Only show the interface provided by macros #30074

Merged
merged 3 commits into from
Nov 28, 2015
Merged

Rustdoc: Only show the interface provided by macros #30074

merged 3 commits into from
Nov 28, 2015

Conversation

jonas-schievink
Copy link
Contributor

Fixes #17616

New docs for panic!:

macro_rules! panic {
    () => { ... };
    ($msg:expr) => { ... };
    ($fmt:expr, $($arg:tt)+) => { ... };
}

New docs for assert!:

macro_rules! assert {
    ( $ cond : expr ) => { ... };
    (
$ cond : expr , $ ( $ arg : tt ) + ) => { ... };
}

not pretty, but at least it's not worse 😂

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@jonas-schievink
Copy link
Contributor Author

Added a semicolon to all arms, to make the docs more similar to the actual macro syntax

@sanxiyn
Copy link
Member

sanxiyn commented Nov 27, 2015

Can you add a test? See tests under src/test/rustdoc.

@jonas-schievink
Copy link
Contributor Author

Test added

@sanxiyn
Copy link
Member

sanxiyn commented Nov 28, 2015

@bors r+

@bors
Copy link
Contributor

bors commented Nov 28, 2015

📌 Commit ff339bd has been approved by sanxiyn

@bors
Copy link
Contributor

bors commented Nov 28, 2015

⌛ Testing commit ff339bd with merge 5ea65c0...

bors added a commit that referenced this pull request Nov 28, 2015
Fixes #17616

New docs for `panic!`:
```rust
macro_rules! panic {
    () => { ... };
    ($msg:expr) => { ... };
    ($fmt:expr, $($arg:tt)+) => { ... };
}
```

New docs for `assert!`:
```rust
macro_rules! assert {
    ( $ cond : expr ) => { ... };
    (
$ cond : expr , $ ( $ arg : tt ) + ) => { ... };
}
```
<sup>not pretty, but at least it's not worse 😂
@bors bors merged commit ff339bd into rust-lang:master Nov 28, 2015
@jonas-schievink jonas-schievink deleted the macro-doc branch December 26, 2015 10:11
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