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 9 pull requests #120041

Closed

Commits on Jan 7, 2024

  1. Configuration menu
    Copy the full SHA
    c4b1054 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da235ce View commit details
    Browse the repository at this point in the history
  3. Fix comment.

    cjgillot committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    3082028 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d6723a View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2024

  1. Enable Static Builds for FreeBSD

    Enable crt-static for FreeBSD to enable statically compiled binaries.
    rellerreller committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    adce3fd View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. Change return type of unstable Waker::noop() from Waker to &Waker.

    The advantage of this is that it does not need to be assigned to a
    variable to be used in a `Context` creation, which is the most common
    thing to want to do with a noop waker.
    
    If an owned noop waker is desired, it can be created by cloning, but the
    reverse is harder. Alternatively, both versions could be provided, like
    `futures::task::noop_waker()` and `futures::task::noop_waker_ref()`, but
    that seems to me to be API clutter for a very small benefit, whereas
    having the `&'static` reference available is a large benefit.
    
    Previous discussion on the tracking issue starting here:
    rust-lang#98286 (comment)
    kpreid committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    7df054b View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary lets and borrowing from Waker::noop() usage.

    `Waker::noop()` now returns a `&'static Waker` reference, so it can be
    passed directly to `Context` creation with no temporary lifetime issue.
    kpreid committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    219b00d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9a8f117 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cd90143 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7052188 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ee370a1 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. Configuration menu
    Copy the full SHA
    3599c18 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    450cb5e View commit details
    Browse the repository at this point in the history
  3. add test for non-defining use of TAIT in foreign function item

    Lukas Markeffsky committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    22833c1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e12101c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ee007ab View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2024

  1. Rollup merge of rust-lang#115291 - cjgillot:dest-prop-save, r=JakobDegen

    Save liveness results for DestinationPropagation
    
    `DestinationPropagation` needs to verify that merge candidates do not conflict with each other. This is done by verifying that a local is not live when its counterpart is written to.
    
    To get the liveness information, the pass runs `MaybeLiveLocals` dataflow analysis repeatedly, once for each propagation round. This is quite costly, and the main driver for the perf impact on `ucd` and `diesel`. (See rust-lang#115105 (comment))
    
    In order to mitigate this cost, this PR proposes to save the result of the analysis into a `SparseIntervalMatrix`, and mirror merges of locals into that matrix: `liveness(destination) := liveness(destination) union liveness(source)`.
    
    <details>
    <summary>Proof</summary>
    
    We denote by `'` all the quantities of the transformed program. Let $\varphi$ be a mapping of locals, which maps `source` to `destination`, and is identity otherwise. The exact liveness set after a statement is $out'(statement)$, and the proposed liveness set is $\varphi(out(statement))$.
    
    Consider a statement. Suppose that the output state verifies $out' \subset phi(out)$. We want to prove that $in' \subset \varphi(in)$ where $in = (out - kill) \cup gen$, and conclude by induction.
    
    We have 2 cases: either that statement is kept with locals renumbered by $\varphi$, or it is a tautological assignment and it removed.
    
    1. If the statement is kept: the gen-set and the kill-set of $statement' = \varphi(statement)$ are $gen' = \varphi(gen)$ and $kill' = \varphi(kill)$ exactly.
    From soundness requirement 3, $\varphi(in)$ is disjoint from $\varphi(kill)$.
    This implies that $\varphi(out - kill)$ is disjoint from $\varphi(kill)$, and so $\varphi(out - kill) = \varphi(out) - \varphi(kill)$. Then $\varphi(in) = (\varphi(out) - \varphi(kill)) \cup \varphi(gen) = (\varphi(out) - kill') \cup gen'$.
    We can conclude that $out' \subset \varphi(out) \implies in' \subset \varphi(in)$.
    
    2. If the statement is removed. As $\varphi(statement)$ is a tautological assignment, we know that $\varphi(gen) = \varphi(kill) = \\{ destination \\}$, while $gen' = kill' = \emptyset$. So $\varphi(in) = \varphi(out) \cup \\{ destination \\}$. Then $in' = out' \subset out \subset \varphi(in)$.
    
    By recursion, we can conclude by that $in' \subset \varphi(in)$ everywhere.
    </details>
    
    This approximate liveness results is only suboptimal if there are locals that fully disappear from the CFG due to an assignment cycle. These cases are quite unlikely, so we do not bother with them.
    
    This change allows to reduce the perf impact of DestinationPropagation by half on diesel and ucd (rust-lang#115105 (comment)).
    
    cc `@JakobDegen`
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    cf3bedb View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#119651 - novafacing:proc_macro_c_str_litera…

    …ls, r=Amanieu
    
    proc_macro: Add Literal::c_string constructor
    
    Adds a constructor for C string literals, hopefully starts addressing rust-lang#118560.
    
    Tracking issue: rust-lang#119750
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    dbf960a View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#119855 - rellerreller:freebsd-static, r=wes…

    …leywiser
    
    Enable Static Builds for FreeBSD
    
    Enable crt-static for FreeBSD to enable statically compiled binaries.
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    f2a74e2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#119955 - kamalesh0406:master, r=WaffleLapkin

    Modify GenericArg and Term structs to use strict provenance rules
    
    This is the first PR to solve issue rust-lang#119217 . In this PR, I have modified the GenericArg struct to use the `NonNull` struct as the pointer instead of `NonZeroUsize`. The change were tested by running `./x test compiler/rustc_middle`.
    
    Resolves rust-lang#119217
    
    r? `@WaffleLapkin`
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    fb713ec View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#119975 - lukas-code:inferring-return-types-…

    …and-opaque-types-do-mix-sometimes, r=compiler-errors
    
    Don't ICE if TAIT-defining fn contains a closure with `_` in return type
    
    The `delay_span_bug` got added in rust-lang@0e82aae to reduce the amount of errors emitted for functions that have `_` in their return type, because inference doesn't apply to function items. But this logic shouldn't apply to closures, because their return types *can* be inferred.
    
    Fixes rust-lang#119916.
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    f4a27e8 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#119984 - kpreid:waker-noop, r=dtolnay

    Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`.
    
    The advantage of this is that it does not need to be assigned to a variable to be used in a `Context` creation, which is the most common thing to want to do with a noop waker. It also avoids unnecessarily executing the dynamically dispatched drop function when the noop waker is dropped.
    
    If an owned noop waker is desired, it can be created by cloning, but the reverse is harder to do since it requires declaring a constant. Alternatively, both versions could be provided, like `futures::task::noop_waker()` and `futures::task::noop_waker_ref()`, but that seems to me to be API clutter for a very small benefit, whereas having the `&'static` reference available is a large reduction in boilerplate.
    
    [Previous discussion on the tracking issue starting here](rust-lang#98286 (comment))
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    9d2a205 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#120001 - dtolnay:bootstrapbootstrap, r=onur…

    …-ozkan
    
    Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap
    
    Since rust-lang#113906, all x.py invocations performed by rust-analyzer have RUSTC_BOOTSTRAP=1 set. This was to fix rust-lang#112391 (comment) &mdash; rust-analyzer uses some default cargo from the system when fetching workspace layout, and the standard library uses some unstable cargo feature, so x.py would previously fail if the system toolchain wasn't nightly.
    
    https://github.com/rust-lang/rust/blob/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/Cargo.toml#L1
    
    This PR changes x.py to cancel out this RUSTC_BOOTSTRAP=1 when compiling bootstrap. It will only remain set when running the compiled bootstrap executable. This fixes spurious bootstrap rebuilds in the event that a rust-analyzer x.py invocation is alternated with someone running x.py themself on the command line, if any dependency of bootstrap looks at `option_env!("RUSTC_BOOTSTRAP")`, which is the case since rust-lang#119654.
    
    **Before:**
    
    ```console
    $ RUSTC_BOOTSTRAP=1 ./x.py check library/core
    Building bootstrap
       Compiling proc-macro2 v1.0.76
       Compiling quote v1.0.35
       Compiling syn v2.0.48
       Compiling clap_derive v4.4.7
       Compiling serde_derive v1.0.195
       Compiling clap v4.4.13
       Compiling clap_complete v4.4.6
       Compiling build_helper v0.1.0
       Compiling bootstrap v0.0.0
        Finished dev [unoptimized] target(s) in 6.31s
    Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.23s
    Build completed successfully in 0:00:07
    
    $ ./x.py check library/core
    Building bootstrap
       Compiling proc-macro2 v1.0.76
       Compiling quote v1.0.35
       Compiling syn v2.0.48
       Compiling clap_derive v4.4.7
       Compiling serde_derive v1.0.195
       Compiling clap v4.4.13
       Compiling clap_complete v4.4.6
       Compiling build_helper v0.1.0
       Compiling bootstrap v0.0.0
        Finished dev [unoptimized] target(s) in 5.30s
    Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.25s
    Build completed successfully in 0:00:06
    ```
    
    **After:**
    
    ```console
    $ RUSTC_BOOTSTRAP=1 ./x.py check library/core
    Building bootstrap
        Finished dev [unoptimized] target(s) in 0.06s
    Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.14s
    Build completed successfully in 0:00:01
    
    $ ./x.py check library/core
    Building bootstrap
        Finished dev [unoptimized] target(s) in 0.04s
    Checking stage0 library artifacts {core} (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.13s
    Build completed successfully in 0:00:01
    ```
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    2541b42 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#120020 - oli-obk:long_const_eval_err_taint,…

    … r=compiler-errors
    
    Gracefully handle missing typeck information if typeck errored
    
    fixes rust-lang#116893
    
    I created some logs and the typeck of `fn main` is exactly the same, no matter whether the constant's body is what it is, or if it is replaced with `panic!()`. The latter will cause the ICE not to be emitted though. The reason for that is that we abort compilation if *errors* were emitted, but not if *lint errors* were emitted. This took me way too long to debug, and is another reason why I would have liked rust-lang/compiler-team#633
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    7693297 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#120032 - Nadrieril:fix-rustc_abi, r=Nilstrieb

    Fix `rustc_abi` build on stable
    
    rust-lang#119446 broke the ability of `rustc_abi` to build on stable, which is required by rust-analyzer. This fixes it.
    compiler-errors authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    7ae18f0 View commit details
    Browse the repository at this point in the history