1. 24 1月, 2018 1 次提交
  2. 23 1月, 2018 10 次提交
    • B
      Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus · 3a39b2aa
      bors 提交于
      Multiple themes for rustdoc
      
      r? @QuietMisdreavus
      3a39b2aa
    • B
      Auto merge of #47046 - Manishearth:intra-doc-links,... · 48a7ea9c
      bors 提交于
      Auto merge of #47046 - Manishearth:intra-doc-links, r=eddyb,GuillaumeGomez,QuietMisdreavus,Manishearth
      
      Implement RFC 1946 - intra-rustdoc links
      
      https://github.com/rust-lang/rfcs/pull/1946 https://github.com/rust-lang/rust/issues/43466
      
      Note for reviewers: The plain line counts are a little inflated because of how the markdown link parsing was done. [Read the file diff with "whitespace only" changes removed](https://github.com/rust-lang/rust/pull/47046/files?w=1) to get a better view of what actually changed there.
      
      This pulls the name/path resolution mechanisms out of the compiler and runs it on the markdown in a crate's docs, so that links can be made to `SomeStruct` directly rather than finding the folder path to `struct.SomeStruct.html`. Check the `src/test/rustdoc/intra-paths.rs` test in this PR for a demo. The change was... a little invasive, but unlocks a really powerful mechanism for writing documentation that doesn't care about where an item was written to on the hard disk.
      
      Items included:
      
       - [x] Make work with the hoedown renderer
       - [x] Handle relative paths
       - [x] Parse out the "path ambiguities" qualifiers (`[crate foo]`, `[struct Foo]`, `[foo()]`, `[static FOO]`, `[foo!]`, etc)
       - [x] Resolve foreign macros
       - [x] Resolve local macros
       - [x] Handle the use of inner/outer attributes giving different resolution scopes (handling for non-modules pushed to different PR)
      
      Items not included:
      
       - [ ] Make sure cross-crate inlining works (blocked on refactor described in https://github.com/rust-lang/rust/pull/47046#issuecomment-354824520)
       - [ ] Implied Shortcut Reference Links (where just doing `[::std::iter::Iterator][]` without a reference anchor will resolve using the reference name rather than the link target) (requires modifying the markdown parser - blocked on Hoedown/Pulldown switch and https://github.com/google/pulldown-cmark/issues/121)
       - [ ] Handle enum variants and UFCS methods (Enum variants link to the enum page, associated methods don't link at all)
       - [ ] Emit more warnings/errors when things fail to resolve (linking to a value-namespaced item without a qualifier will emit an error, otherwise the link is just treated as a url, not a rust path)
       - [ ] Give better spans for resolution errors (currently the span for the first doc comment is used)
       - [ ] Check for inner doc comments on things that aren't modules
      
      I'm making the PR, but it should be noted that most of the work was done by Misdreavus 😄
      
      (Editor's note: This has become a lie, check that commit log, Manish did a ton of work after this PR was opened `>_>`)
      48a7ea9c
    • G
      Fasten even more theme switch · 5b850440
      Guillaume Gomez 提交于
      5b850440
    • B
      Auto merge of #47373 - wesleywiser:incr_cache_hashing, r=michaelwoerister · 47a8eb7c
      bors 提交于
      [Incremental] Cache hashes for AdDef and ty::Slice<T>
      
      r? @michaelwoerister
      47a8eb7c
    • Q
      don't process code blocks when scanning for links · 63811b66
      QuietMisdreavus 提交于
      63811b66
    • G
      Fasten up theme loading · 5f93159e
      Guillaume Gomez 提交于
      5f93159e
    • G
      Change theme icon · 3c52acd9
      Guillaume Gomez 提交于
      3c52acd9
    • B
      Auto merge of #47507 - alexcrichton:rerun-bat-scripts, r=michaelwoerister · ae920dcc
      bors 提交于
      rustc: Lower link args to `@`-files on Windows more
      
      When spawning a linker rustc has historically been known to blow OS limits for
      the command line being too large, notably on Windows. This is especially true of
      incremental compilation where there can be dozens of object files per
      compilation. The compiler currently has logic for detecting a failure to spawn
      and instead passing arguments via a file instead, but this failure detection
      only triggers if a process actually fails to spawn.
      
      Unfortunately on Windows we've got something else to worry about which is
      `cmd.exe`. The compiler may be running a linker through `cmd.exe` where
      `cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
      Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
      it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
      detect.
      
      Consequently this commit updates the logic for the spawning the linker on
      Windows to instead have a heuristic to see if we need to pass arguments via a
      file. This heuristic is an overly pessimistic and "inaccurate" calculation which
      just calls `len` on a bunch of `OsString` instances (where `len` is not
      precisely the length in u16 elements). This number, when exceeding the 6k
      threshold, will force rustc to always pass arguments through a file.
      
      This strategy should avoid us trying to parse the output on Windows of the
      linker to see if it successfully spawned yet failed to actually sub-spawn the
      linker. We may just be passing arguments through files a little more commonly
      now...
      
      The motivation for this commit was a recent bug in Gecko [1] when beta testing,
      notably when incremental compilation was enabled it blew out the limit on
      `cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
      bat script as well (and we're blowing the limit there).
      
      [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886
      
      Closes #46999
      ae920dcc
    • Q
      tweak colors on dark theme · aae6dc4f
      QuietMisdreavus 提交于
      aae6dc4f
    • M
  3. 22 1月, 2018 29 次提交