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 8 pull requests #98381

Closed
wants to merge 24 commits into from
Closed

Commits on Jun 20, 2022

  1. Configuration menu
    Copy the full SHA
    a336686 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    448e00b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1e7ab0b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3f12fa7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dda980d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f001795 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    810254b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f4db07e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    987c731 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    beb2f36 View commit details
    Browse the repository at this point in the history
  11. rustdoc: optimize loading of source sidebar

    The source sidebar has a setting to remember whether it should be open or
    closed. Previously, this setting was handled in source-script.js, which
    is loaded with `defer`, meaning it is often run after the document is rendered.
    Since CSS renders the source sidebar as closed by default, changing this
    after the initial render results in a relayout.
    
    Instead, handle the setting in storage.js, which is the first script to load
    and is the only script that blocks render. This avoids a relayout and means
    navigating between files with the sidebar open is faster.
    jsha committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    b37a05b View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2022

  1. Configuration menu
    Copy the full SHA
    e900a35 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f924e74 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a0eba66 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2022

  1. Configuration menu
    Copy the full SHA
    f847261 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eb86daa View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#91264 - GuillaumeGomez:macro-jump-to-def, r…

    …=jsha
    
    Add macro support in jump to definition feature
    
    Fixes rust-lang#91174.
    
    To do so, I check if the span comes from an expansion, and if so, I infer the original macro `DefId` or `Span` depending if it's a defined in the current crate or not.
    
    There is one limitation due to macro expansion though:
    
    ```rust
    macro_rules! yolo { () => {}}
    
    fn foo() {
        yolo!();
    }
    ```
    
    In `foo`, `yolo!` won't be linked because after expansion, it is replaced by nothing (which seems logical). So I can't get an item from the `Visitor` from which I could tell if its `Span` comes from an expansion.
    
    I added a test for this specific limitation alongside others.
    
    Demo: https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html
    
    As for the empty macro issue that cannot create a jump to definition, you can see it [here](https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html#35).
    
    r? `@jyn514`
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    ef5ff2f View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#98184 - compiler-errors:elided-lifetime-in-…

    …impl-nll, r=cjgillot
    
    Give name if anonymous region appears in impl signature
    
    Fixes rust-lang#98170
    
    We probably should remove the two unwraps in [`report_general_error`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_borrowck/diagnostics/region_errors.rs.html#683-685), but I have no idea what to provide if those regions are missing, so I've kept those in. Let me know if I should try harder to remove those.
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    c26b9dd View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#98269 - compiler-errors:provide-more-segmen…

    …t-res, r=petrochenkov
    
    Provide a `PathSegment.res` in more cases
    
    I find that in many cases, the `res` associated with a `PathSegment` is `Res::Err` even though the path was fully resolved. A few diagnostics use this `res` and their error messages suffer because of the lack of resolved segment.
    
    This fixes it a bit, but it's obviously not complete and I'm not exactly sure if it's correct.
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    9ee8708 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#98277 - compiler-errors:issue-93596, r=este…

    …bank
    
    Fix trait object reborrow suggestion
    
    Fixes rust-lang#93596
    
    Slightly generalizes the logic we use to suggest fix first implemented in rust-lang#95609, specifically when we have a `Sized` obligation that comes from a struct's unsized tail.
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    4a72e16 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#98283 - TaKO8Ki:point-at-private-fields-in-…

    …struct-literal, r=compiler-errors
    
    Point at private fields in struct literal
    
    closes rust-lang#95872
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    082289e View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#98305 - klensy:no-err-alloc, r=compiler-errors

    prohibit_generics: don't alloc error string if no error emitted
    
    Noticed unreaded allocs in DHAT.
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    74abe7c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#98310 - jsha:defer-source-sidebar, r=Guilla…

    …umeGomez
    
    rustdoc: optimize loading of source sidebar
    
    The source sidebar has a setting to remember whether it should be open or
    closed. Previously, this setting was handled in source-script.js, which
    is loaded with `defer`, meaning it is often run after the document is rendered.
    Since CSS renders the source sidebar as closed by default, changing this
    after the initial render results in a relayout.
    
    Instead, handle the setting in storage.js, which is the first script to load
    and is the only script that blocks render. This avoids a relayout and means
    navigating between files with the sidebar open is faster.
    
    Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html
    
    r? `@GuillaumeGomez`
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    3a97aba View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#98337 - c410-f3r:assert-compiler, r=oli-obk

    [RFC 2011] Optimize non-consuming operators
    
    Tracking issue: rust-lang#44838
    Fifth step of rust-lang#96496
    
    The most non-invasive approach that will probably have very little to no performance impact.
    
    ## Current behaviour
    
    Captures are handled "on-the-fly", i.e., they are performed in the same place expressions are located.
    
    ```rust
    // `let a = 1; let b = 2; assert!(a > 1 && b < 100);`
    
    if !(
      { ***try capture `a` and then return `a`*** } > 1 && { ***try capture `b` and then return `b`*** } < 100
    ) {
      panic!( ... );
    }
    ```
    
    As such, some overhead is likely to occur (Specially with very large chains of conditions).
    
    ## New behaviour for non-consuming operators
    
    When an operator is known to not take `self`, then it is possible to capture variables **AFTER** the condition.
    
    ```rust
    // `let a = 1; let b = 2; assert!(a > 1 && b < 100);`
    
    if !( a > 1 && b < 100 ) {
      { ***try capture `a`*** }
      { ***try capture `b`*** }
      panic!( ... );
    }
    ```
    
    So the possible impact on the runtime execution time will be diminished.
    
    r? `@oli-obk`
    Dylan-DPC authored Jun 22, 2022
    Configuration menu
    Copy the full SHA
    77732a5 View commit details
    Browse the repository at this point in the history