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

Rollup of 6 pull requests #98321

Closed
wants to merge 18 commits into from

Commits on Jun 19, 2022

  1. Remove Cursor::append.

    It's a weird function: it lets you modify the token stream in the middle
    of iteration. There is only one call site, and it is only used for the
    rare `ProceduralMasquerade` legacy case.
    nnethercote committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    ccd956a View commit details
    Browse the repository at this point in the history
  2. Remove Cursor::index.

    It's unused.
    nnethercote committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    178b746 View commit details
    Browse the repository at this point in the history
  3. Remove TokenStream::from_streams.

    By inlining it into the only non-test call site. The one test call site
    is changed to use `TokenStreamBuilder`.
    nnethercote committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    f6b5788 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2022

  1. Merge TokenStreamBuilder::push into TokenStreamBuilder::build.

    Both functions do some modifying of streams using `make_mut`:
    - `push` sometimes glues the first token of the next stream to the last
      token of the first stream.
    - `build` appends tokens to the first stream.
    
    By doing all of this in the one place, things are simpler. The first
    stream can be modified in both ways (if necessary) in the one place, and
    any next stream with the first token removed doesn't need to be stored.
    nnethercote committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    2a5487a View commit details
    Browse the repository at this point in the history
  2. Add blank lines between methods in proc_macro_server.rs.

    Because that's the standard way of doing it.
    nnethercote committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    69f45b7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    edb6c4b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f30c76a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3ea686f View commit details
    Browse the repository at this point in the history
  6. try_fold_unevaluated for infallible folders

    rust-lang#97447 added folding of unevaluated constants, but did not include an override of the default (fallible) operation in the blanket impl of `FallibleTypeFolder` for infallible folders.  Here we provide that missing override.
    
    r? @nnethercote
    eggyal committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    bd60475 View commit details
    Browse the repository at this point in the history
  7. Improve loading of crates.js and sidebar-items.js

    Now that the "All Crates" dropdown is only rendered on the search results page,
    there is no need to load crates.js on most pages. Load it only on crate pages.
    Also, add the `defer` attribute so it does not block page rendering.
    
    For sidebar-items.js, move the script tag to `<head>`. Since it already has the
    defer attribute it won't block loading. The defer attribute does preserve
    ordering between scripts, so instead of the callback on load, it can set a
    global variable on load, which is slightly simpler. Also, since it is required
    to finish rendering the page, beginning its load earlier is better.
    
    Remove generation and handling of sidebar-vars. Everything there can be computed
    with information available in JS via other means.
    
    Remove the "other" wrapper in the sidebar. It was unnecessary.
    
    Remove excess script fields
    jsha committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    27dcebe View commit details
    Browse the repository at this point in the history
  8. Reverse folder hierarchy

    rust-lang#91318 introduced a trait for infallible folders distinct from the fallible version.  For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible.  Moreover the `Error` associated type was defined on the infallible trait!  It's so absurd that it has me questioning whether I was entirely sane.
    
    This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation).  This of course makes much more sense!  It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs.
    
    There is one downside however: folders expose a `tcx` accessor method.  Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate.  Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate.  If desired, I can submit that as a separate PR.
    
    r? @jackh726
    eggyal committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    2526b08 View commit details
    Browse the repository at this point in the history
  9. Remove lies in comments.

    m-ou-se committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    a171a6b View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2022

  1. Rollup merge of rust-lang#97085 - rylev:test-issue-33172, r=wesleywiser

    Add a test for issue rust-lang#33172
    
    Adds a test confirming that rust-lang#33172 has been fixed.
    
    CDB has some surprising results as it looks like the supposedly unmangled static's symbol name is prefixed when it shouldn't be.
    
    r? ``@wesleywiser``
    
    Closes rust-lang#33172
    matthiaskrgr committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    7ec1840 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#98124 - jsha:defer-crates, r=GuillaumeGomez

    Improve loading of crates.js and sidebar-items.js
    
    Now that the "All Crates" dropdown is only rendered on the search results page,
    there is no need to load crates.js on most pages. Load it only on crate pages.
    Also, add the `defer` attribute so it does not block HTML parsing.
    
    For sidebar-items.js, move the script tag to `<head>`. Since it already has the
    defer attribute it won't block loading. The defer attribute does preserve
    ordering between scripts, so instead of the callback on load, it can set a
    global variable on load, which is slightly simpler. Also, since it is required
    to finish rendering the page, beginning its load earlier is better.
    
    Remove generation and handling of sidebar-vars. Everything there can be computed
    with information available in JS via other means.
    
    Remove the extra_scripts fields of the `Page` template. They were only
    used by source-script.js and source-files.js, which are now linked by the template
    based on whether it is rendering a source page.
    
    Remove the "other" wrapper in the sidebar. It was unnecessary.
    
    r? `@GuillaumeGomez`
    
    Demo: https://rustdoc.crud.net/jsha/defer-crates/std/index.html
    matthiaskrgr committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    2684d6a View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#98278 - nnethercote:some-token-stream-clean…

    …ups, r=petrochenkov
    
    Some token stream cleanups
    
    Best reviewed one commit at a time.
    
    r? `@petrochenkov`
    matthiaskrgr committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    0de1e04 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#98306 - eggyal:add-unevaluated-to-blanket-f…

    …allibletypefolder, r=nnethercote
    
    `try_fold_unevaluated` for infallible folders
    
    rust-lang#97447 added folding of unevaluated constants, but did not include an override of the default (fallible) operation in the blanket impl of `FallibleTypeFolder` for infallible folders.  Here we provide that missing override.
    
    r? `@nnethercote`
    matthiaskrgr committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    5d3dcd1 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#98311 - eggyal:reverse-folder-hierarchy, r=…

    …jackh726
    
    Reverse folder hierarchy
    
    rust-lang#91318 introduced a trait for infallible folders distinct from the fallible version.  For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible.  Moreover the `Error` associated type was defined on the infallible trait!  It's so absurd that it has me questioning whether I was entirely sane.
    
    This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation).  This of course makes much more sense!  It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs.
    
    There is one downside however: folders expose a `tcx` accessor method.  Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate.  Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate.  If desired, I can submit that as a separate PR.
    
    r? `@jackh726`
    matthiaskrgr committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    3365a50 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#98313 - m-ou-se:fix-comments, r=joshtriplett

    Remove lies in comments.
    
    > does not have a const constructor
    
    > pub const fn new() -> Self
    
    🤔
    matthiaskrgr committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    a6305a8 View commit details
    Browse the repository at this point in the history