rust-lang / prev.rust-lang.org

The previous Rust website. The current website's code is at https://github.com/rust-lang/www.rust-lang.org.
https://prev.rust-lang.org
Apache License 2.0
151 stars 340 forks source link

Broken link to the libc crate #243

Open nodakai opened 8 years ago

nodakai commented 8 years ago

https://doc.rust-lang.org/std/ -> click "libc" on the left column -> https://doc.rust-lang.org/libc/index.html which looks like a directory listing

brson commented 8 years ago

Thanks for the report. I do think this is intentional since we are producing libc's for every supported platform. cc @alexcrichton

alexcrichton commented 8 years ago

Yeah this is currently intentional, the idea is that you can go from there to look at the documentation for any architecture.

alexcrichton commented 8 years ago

Albeit it could be styled much better

nodakai commented 8 years ago

Understood it was intentional but can we achieve it natively with rustdoc ?

We already have src/windows.rs and src/unix/lib.rs... Can we just parallelly expose them to rustdoc? To differentiate different flavors of Unix, how do you like:

## unix/lib.rs

cfg_if! {
    if #[(all(target_os = "linux", target_arch = "x86_64")] {
        mod linux_x86_64;
        pub use linux_x86_64::*;
    } else if #[(all(target_os = "android", target_arch = "arm")] {
        mod android_arm;
        pub use anrdoid_arm::*;
    }
}

pub mod linux_x86_64 {
}
alexcrichton commented 8 years ago

While that may work for Unix/Windows that doesn't necessarily work for FreeBSD/Linux (for example) due to the way the source is structured.