Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    QuietMisdreavus
    @QuietMisdreavus
    nice, i like it!
    Ranveer Aggarwal
    @ranveeraggarwal
    Hello! I'm new to Rust (written a few hundred lines to get a hang of rustc) and am looking for something to work on. I would love to work on rustdoc and to get started, I am looking for an easy issue (with mentorship, if possible).
    QuietMisdreavus
    @QuietMisdreavus
    @ranveeraggarwal Thanks for checking out rustdoc! I'll see if i can rummage through the issues at some point today to find you one
    there's certainly a ton to wade through, but only a few that don't need a whole lot of familiarity with the codebase
    (also sorry for totally missing your message yesterday! >_>)
    Ranveer Aggarwal
    @ranveeraggarwal
    Thank you! :smile:
    I'm hoping to build the familiarity with a couple of simple issues and then help out with the bigger ones.
    QuietMisdreavus
    @QuietMisdreavus
    yeah!
    rustdoc isn't all that complicated to move around in, it just has the disadvantage of being part of the compiler's build system
    (also a few 3000-line files >_>)
    Ranveer Aggarwal
    @ranveeraggarwal

    (also a few 3000-line files >_>)

    Ouch, it's going to take a while then. Up for the challenge :D

    QuietMisdreavus
    @QuietMisdreavus
    nah, if i find an issue for you (or if you find one and bring it here) then i can usually point you to where in the file you need to look at
    Ranveer Aggarwal
    @ranveeraggarwal
    Awesome!
    QuietMisdreavus
    @QuietMisdreavus
    so if you get antsy and want to go hunting before i get to it, feel free to wander through the full list https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AA-rustdoc
    (i've got some dayjob stuff to take care of today, so it may be a bit before i can go actively searching)
    Ranveer Aggarwal
    @ranveeraggarwal
    Sure
    QuietMisdreavus
    @QuietMisdreavus
    @ranveeraggarwal so here's one i wanted to see myself recently rust-lang/rust#45150
    (i didn't know if it had an issue already so i just opened one for it >_>)
    i just mentored someone else on something very similar recently (in fact it's the last thing in the backlog if you scroll back above when you entered) so i know this will be small
    rustdoc is in the rust-lang/rust repo, so if you don't have that set up yet that's step zero
    otherwise, in src/librustdoc/html/render.rs there's a function called item_trait that prints everything in the main body of a trait page
    QuietMisdreavus
    @QuietMisdreavus
    specifically for this, it defines an inner function called trait_item that it runs on everything in the trait definition (associated items and methods) to print its docs https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/render.rs#L2365-L2381
    [src] links are created with the help of a local Item type and its method src_href, which tries to assemble a URL for the given item
    the PR from earlier added a src link farther down in item_trait, so you can even steal its html generation for it, since it'll work the same https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/render.rs#L2494-L2499
    QuietMisdreavus
    @QuietMisdreavus
    so the smallest change that would add this would just copy/paste that block into trait_item (the inner function) after the render_stability_since call
    item_trait takes two Items, so the one you want is m - the other one is the trait itself
    hopefully that all makes sense
    this is arguably the smallest change you could make to rustdoc, but it's still a really useful one
    (saving things like little css changes or typo fixes, i guess)
    Ranveer Aggarwal
    @ranveeraggarwal
    Looks good, thanks! I will clone the repo and get to it :grin:
    QuietMisdreavus
    @QuietMisdreavus
    awesome! let me know if you run into any issues
    Ranveer Aggarwal
    @ranveeraggarwal
    Sure!
    QuietMisdreavus
    @QuietMisdreavus
    since you said you're cloning the repo now, i'll point you to the setup tips in the bottom 2/3 of this post https://quietmisdreavus.net/code/2017/09/18/come-work-on-rustdoc/
    that should help get you most of the way there
    Ranveer Aggarwal
    @ranveeraggarwal
    Awesome, I guess I have everything required. I live in an opposite (D/N) timezone, so it'll be a while until I get back.
    QuietMisdreavus
    @QuietMisdreavus
    oh, no worries
    gitter has persistent server-side logs, so if you leave a question in here i'll see it the next time i'm on
    Ranveer Aggarwal
    @ranveeraggarwal
    Hello! I am trying to build the rust compiler locally, and am stuck on the "Building stage1 std artifacts" stage. I ran a clean-build a couple of times, it's stuck there. Any idea why this could be happening?
    Stuck = 4+ hours, no message on my terminal.
    System spec: MacOS 10.13, 2.7 GHz dual core i5, 8 GB RAM (so I don't think it's because of a slow machine)
    QuietMisdreavus
    @QuietMisdreavus
    oh dear D:
    i've had problems with x.py clean before, what happens if you just torch the build/$TARGET directory entirely? you could probably get away with keeping llvm and native if you don't want to start completely over
    Ranveer Aggarwal
    @ranveeraggarwal
    Hmm, I see. I'll try this out fingers crossed
    Mark Simulacrum
    @Mark-Simulacrum
    @ranveeraggarwal I'd try something like find build -name '.cargo-lock' -delete
    If you kill Cargo at the wrong point it will indefinitely wait for a nonexistent cargo to finish
    Ranveer Aggarwal
    @ranveeraggarwal
    I actually torched the build folder and tried rebuilding. Same problem :/
    Daan Rijks
    @ijks
    Hey! I'm interested in working on rustdoc. I'd say my Rust is at an intermediate level. What are some issues I could look at?
    QuietMisdreavus
    @QuietMisdreavus
    @ijks hey, sorry for missing this yesterday! i'll see if i can dig up something for you later today
    in the meantime, if you want to get familiar with the code, the best place to dig around is src/librustdoc/html/render.rs in the rust-lang/rust repo
    that's where most of the code that creates the HTML is
    QuietMisdreavus
    @QuietMisdreavus
    each individual kind of page goes through this Display impl here and gets dispatched to one of these functions to fill it in https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/render.rs#L1759-L1773
    Daan Rijks
    @ijks
    @QuietMisdreavus Thanks! I'll take a look at that tomorrow.