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

rustup #2903

Merged
merged 15 commits into from
May 29, 2023
Merged

rustup #2903

merged 15 commits into from
May 29, 2023

Commits on May 26, 2023

  1. Auto merge of #111562 - clubby789:speedup-bootstrap-py, r=jyn514

    Improve startup time of bootstrap
    
    ~~If the user has a `build/host` symlink set up, we can determine the target triple by reading it rather than invoking rustc. This significantly reduces startup time of bootstrap once any kind of build has been done~~
    New approach explained below
    ```
    ➜  hyperfine -p 'git checkout -q master' -N './x.py -h' -r 50
    Benchmark 1: ./x.py -h
      Time (mean ± σ):     140.7 ms ±   2.6 ms    [User: 99.9 ms, System: 39.3 ms]
      Range (min … max):   136.8 ms … 149.6 ms    50 runs
    
    ➜  rust git:(master) hyperfine -p 'git checkout -q speedup-bootstrap-py' -N './x.py -h' -r 50
    Benchmark 1: ./x.py -h
      Time (mean ± σ):      95.2 ms ±   1.5 ms    [User: 67.7 ms, System: 26.7 ms]
      Range (min … max):    92.9 ms …  99.6 ms    50 runs
    ```
    
    Also a small microoptimisation in using string splitting rather than regex when reading toml, which saves a few more milliseconds (2-5 testing locally), but less important.
    
    Profiling shows the remaining runtime is around half setting up the Python runtime, and the vast majority of the remaining time is spent in subprocess building and running bootstrap itself, so probably can't be improved much further.
    bors committed May 26, 2023
    Configuration menu
    Copy the full SHA
    ccfaae4 View commit details
    Browse the repository at this point in the history
  2. Auto merge of #103291 - ink-feather-org:typeid_no_struct_match, r=dto…

    …lnay
    
    Remove structural match from `TypeId`
    
    As per rust-lang/rust#99189 (comment).
    
    > Removing the structural equality might make sense, but is a breaking change that'd require a libs-api FCP.
    
    rust-lang/rust#99189 (comment)
    
    > Landing this PR now (well, mainly the "remove structural equality" part) would unblock `const fn` `TypeId::of`, since we only postponed that because we were guaranteeing too much.
    
    See also #99189, #101698
    bors committed May 26, 2023
    Configuration menu
    Copy the full SHA
    088652f View commit details
    Browse the repository at this point in the history

Commits on May 27, 2023

  1. Auto merge of #111348 - ozkanonur:remove-hardcoded-rustdoc-flags, r=a…

    …lbertlarsan68,oli-obk
    
    new tool `rustdoc-gui-test`
    
    Implements new tool `rustdoc-gui-test` that allows using compiletest headers for `rustdoc-gui` tests.
    bors committed May 27, 2023
    Configuration menu
    Copy the full SHA
    4d3398c View commit details
    Browse the repository at this point in the history
  2. Auto merge of #111928 - c410-f3r:dqewdas, r=eholk

    [RFC-2011] Expand more expressions
    
    cc #44838
    
    Expands `if`, `let`, `match` and also makes `generic_assert_internals` an allowed feature when using `assert!`. `#![feature(generic_assert)]` is still needed to activate everything.
    
    ```rust
    #![feature(generic_assert)]
    
    fn fun(a: Option<i32>, b: Option<i32>, c: Option<i32>) {
      assert!(
        if a.is_some() { 1 } else { 2 } == 3
          && if let Some(elem) = b { elem == 4 } else { false }
          && match c { Some(_) => true, None => false }
      );
    }
    
    fn main() {
      fun(Some(1), None, Some(2));
    }
    
    // Assertion failed: assert!(
    //   if a.is_some() { 1 } else { 2 } == 3
    //     && if let Some(elem) = b { elem == 4 } else { false }
    //     && match c { Some(_) => true, None => false }
    // );
    //
    // With captures:
    //   a = Some(1)
    //   b = None
    //   c = Some(2)
    ```
    bors committed May 27, 2023
    Configuration menu
    Copy the full SHA
    d051c26 View commit details
    Browse the repository at this point in the history
  3. Auto merge of #111934 - scottmcm:stabilize-hash-one, r=Amanieu

    Stabilize `BuildHasher::hash_one`
    
    FCP completed in rust-lang/rust#86161 (comment)
    bors committed May 27, 2023
    Configuration menu
    Copy the full SHA
    322e0c5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    46eddf0 View commit details
    Browse the repository at this point in the history
  5. Auto merge of #110975 - Amanieu:panic_count, r=joshtriplett

    Rework handling of recursive panics
    
    This PR makes 2 changes to how recursive panics works (a panic while handling a panic).
    
    1. The panic count is no longer used to determine whether to force an immediate abort. This allows code like the following to work without aborting the process immediately:
    
    ```rust
    struct Double;
    
    impl Drop for Double {
        fn drop(&mut self) {
            // 2 panics are active at once, but this is fine since it is caught.
            std::panic::catch_unwind(|| panic!("twice"));
        }
    }
    
    let _d = Double;
    
    panic!("once");
    ```
    
    Rustc already generates appropriate code so that any exceptions escaping out of a `Drop` called in the unwind path will immediately abort the process.
    
    2. Any panics while the panic hook is executing will force an immediate abort. This is necessary to avoid potential deadlocks like #110771 where a panic happens while holding the backtrace lock. We don't even try to print the panic message in this case since the panic may have been caused by `Display` impls.
    
    Fixes #110771
    bors committed May 27, 2023
    Configuration menu
    Copy the full SHA
    0e4b033 View commit details
    Browse the repository at this point in the history
  6. Auto merge of #111006 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum

    1.70.0 release notes
    
    r? `@cuviper` `@rust-lang/release`
    bors committed May 27, 2023
    Configuration menu
    Copy the full SHA
    76bd6f9 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2023

  1. Auto merge of #111378 - jieyouxu:local-shadows-glob-reexport, r=petro…

    …chenkov
    
    Add warn-by-default lint when local binding shadows exported glob re-export item
    
    This PR introduces a warn-by-default rustc lint for when a local binding (a use statement, or a type declaration) produces a name which shadows an exported glob re-export item, causing the name from the exported glob re-export to be hidden (see #111336).
    
    ### Unresolved Questions
    
    - [x] ~~Is this approach correct? While it passes the UI tests, I'm not entirely convinced it is correct.~~ Seems to be ok now.
    - [x] ~~What should the lint be called / how should it be worded? I don't like calling `use x::*;` or `struct Foo;` a "local binding" but they are `NameBinding`s internally if I'm not mistaken.~~ ~~The lint is called `local_binding_shadows_glob_reexport` for now, unless a better name is suggested.~~ `hidden_glob_reexports`.
    
    Fixes #111336.
    bors committed May 28, 2023
    Configuration menu
    Copy the full SHA
    71df33e View commit details
    Browse the repository at this point in the history
  2. Auto merge of #112000 - wesleywiser:safestack, r=Amanieu

    Add support for LLVM SafeStack
    
    Adds support for LLVM [SafeStack] which provides backward edge control
    flow protection by separating the stack into two parts: data which is
    only accessed in provable safe ways is allocated on the normal stack
    (the "safe stack") and all other data is placed in a separate allocation
    (the "unsafe stack").
    
    SafeStack support is enabled by passing `-Zsanitizer=safestack`.
    
    [SafeStack]: https://clang.llvm.org/docs/SafeStack.html
    
    cc `@rcvalle` #39699
    bors committed May 28, 2023
    Configuration menu
    Copy the full SHA
    6aa8ce5 View commit details
    Browse the repository at this point in the history
  3. Auto merge of #112001 - saethlin:enable-matchbranchsimplification, r=…

    …cjgillot
    
    Enable MatchBranchSimplification
    
    This pass is one of the small number of benefits from `-Zmir-opt-level=3` that has motivated rustc_codegen_cranelift to use it:
    
    https://github.com/rust-lang/rust/blob/19ed0aade60e1c1038fe40554bcd9d01b717effa/compiler/rustc_codegen_cranelift/build_system/build_sysroot.rs#L244-L246
    
    Cranelift's motivation for this is _runtime_ performance improvements in debug builds. Lifting this pass all the way to `-Zmir-opt-level=1` seems to come without significant perf overhead, so that's what I'm suggesting here.
    bors committed May 28, 2023
    Configuration menu
    Copy the full SHA
    fbd5c25 View commit details
    Browse the repository at this point in the history
  4. Auto merge of #112026 - saethlin:misaligned-addrof, r=pnkfelix

    Don't check for misaligned raw pointer derefs inside Rvalue::AddressOf
    
    From rust-lang/rust#112026 (comment):
    
    rustc 1.70 (stable next week) added a Mir pass to add pointer alignment checks in debug mode. Adding these checks caused some crates to break, but that was expected, since they contain broken code (rust-lang/rust#111487) for tracking that.
    
    However, the checks added are slightly more aggressive than they should have been. Specifically, they also check the place in an `addr_of!` expression. Whether lack of alignment there is or isn't UB is unclear. This PR modifies the pass to not affect those cases.
    
    I spot checked the crater regressions and the ones I saw were not the case that this PR is modifying. It still seems good to not land anything overaggressive though
    bors committed May 28, 2023
    Configuration menu
    Copy the full SHA
    5de417c View commit details
    Browse the repository at this point in the history
  5. Auto merge of #111813 - scottmcm:pretty-mir, r=cjgillot

    MIR: opt-in normalization of `BasicBlock` and `Local` numbering
    
    This doesn't matter at all for actual codegen, but after spending some time reading pre-codegen MIR, I was wishing I didn't have to jump around so much in reading post-inlining code.
    
    So this add two passes that are off by default for every mir level, but can be enabled (`-Zmir-enable-passes=+ReorderBasicBlocks,+ReorderLocals`) for humans.
    bors committed May 28, 2023
    Configuration menu
    Copy the full SHA
    05ad360 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2023

  1. Configuration menu
    Copy the full SHA
    b928d16 View commit details
    Browse the repository at this point in the history
  2. Merge from rustc

    saethlin committed May 29, 2023
    Configuration menu
    Copy the full SHA
    2b3bcd9 View commit details
    Browse the repository at this point in the history