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

"rust doc" (rust.rc driver wrapping rustdoc) does not handle top-level items like "rustdoc" #7381

Closed
pnkfelix opened this issue Jun 25, 2013 · 2 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

Basically, I expect rust doc to behave just like rustdoc. Issue #7380 provides one example where this is not the case, but the issue here seems a bit more serious: Significant portions of the doc are not being emitted, though the files to hold them are being created (and left empty).

Context:

$ rust build --version
rustc 0.6 (e650399 2013-06-12 23:10:15 -0700)
host: x86_64-apple-darwin
$ cat play-doc.rs
#[link( name = "playdoc", vers = "1.0" )];

/// Doc for `w` mod.
pub mod w {
    /// Doc for `f` fn.
    pub fn f() -> int { 3 }
}

/// Doc for `whoa` fn; returns 3.  (Whoa.)
pub fn whoa() -> int { 3 }
$ rm -rf foo
$ cat play-doc.rs
#[link( name = "playdoc", vers = "1.0" )];

/// Doc for `w` mod.
pub mod w {
    /// Doc for `f` fn.
    pub fn f() -> int { 3 }
}

/// Doc for `whoa` fn; returns 3.  (Whoa.)
pub fn whoa() -> int { 3 }

Transcript showing bug (good "rustdoc" behavior first, followed by erroneous "rust doc" behavior second):

$ mkdir foo
$ rm -rf foo/* ; rustdoc play-doc.rs --output-format markdown --output-dir foo 
$ ls -l foo/
total 16
-rw-------  1 fklock  staff  236 Jun 25 15:43 playdoc.md
-rw-------  1 fklock  staff  161 Jun 25 15:43 w.md
$ cat foo/playdoc.md
% Crate playdoc

<div class='index'>

* [Function `whoa`](#function-whoa) - Doc for `whoa` fn; returns 3
* [Module `w`](w.md) - Doc for `w` mod.

</div>

## Function `whoa`

    fn whoa() -> int

Doc for `whoa` fn; returns 3.  (Whoa.)

$ rm -rf foo/* ; rust doc play-doc.rs --output-format markdown --output-dir foo 
$ ls -l foo/
total 8
-rw-------  1 fklock  staff    0 Jun 25 15:43 playdoc.md
-rw-------  1 fklock  staff  161 Jun 25 15:43 w.md
$ cat foo/playdoc.md
$ 
@thestinger
Copy link
Contributor

This is still an issue.

@alexcrichton
Copy link
Member

Rustdoc has been removed, and rustdoc_ng does not suffer from the same problem. Closing.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 4, 2022
New lint `swap_ptr_to_ref`

fixes: rust-lang#7381

changelog: New lint `swap_ptr_to_ref`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants