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 5 pull requests #108530

Closed
wants to merge 12 commits into from
Closed

Commits on Feb 1, 2023

  1. Configuration menu
    Copy the full SHA
    b379d21 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2023

  1. Lazily compute crate name for consider_optimizing

    The extra query is unnecessary in the common case of not having fuel.
    Noratrieb committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    7ee01b4 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2023

  1. Configuration menu
    Copy the full SHA
    6cb3449 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    68f275c View commit details
    Browse the repository at this point in the history
  3. Add tracking issue

    joshtriplett authored and faern committed Feb 26, 2023
    Configuration menu
    Copy the full SHA
    1291216 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. Configuration menu
    Copy the full SHA
    934c8c2 View commit details
    Browse the repository at this point in the history
  2. Implement read_buf for a few more types

    Implement read_buf for TcpStream, Stdin, StdinLock, ChildStdout,
    ChildStderr (and internally for AnonPipe, Handle, Socket), so
    that it skips buffer initialization.
    
    The other provided methods like read_to_string and read_to_end are
    implemented in terms of read_buf and so benefit from the optimization
    as well.
    
    This commit also implements read_vectored and is_read_vectored where
    applicable.
    tmiasko committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    8ab1a2a View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#99767 - LeSeulArtichaut:stable-target-featu…

    …re-11, r=estebank
    
    Stabilize `#![feature(target_feature_11)]`
    
    ## Stabilization report
    
    ### Summary
    
    Allows for safe functions to be marked with `#[target_feature]` attributes.
    
    Functions marked with `#[target_feature]` are generally considered as unsafe functions: they are unsafe to call, cannot be assigned to safe function pointers, and don't implement the `Fn*` traits.
    
    However, calling them from other `#[target_feature]` functions with a superset of features is safe.
    
    ```rust
    // Demonstration function
    #[target_feature(enable = "avx2")]
    fn avx2() {}
    
    fn foo() {
        // Calling `avx2` here is unsafe, as we must ensure
        // that AVX is available first.
        unsafe {
            avx2();
        }
    }
    
    #[target_feature(enable = "avx2")]
    fn bar() {
        // Calling `avx2` here is safe.
        avx2();
    }
    ```
    
    ### Test cases
    
    Tests for this feature can be found in [`src/test/ui/rfcs/rfc-2396-target_feature-11/`](https://github.com/rust-lang/rust/tree/b67ba9ba208ac918228a18321fc3a11a99b1c62b/src/test/ui/rfcs/rfc-2396-target_feature-11/).
    
    ### Edge cases
    
    - rust-lang#73631
    
    Closures defined inside functions marked with `#[target_feature]` inherit the target features of their parent function. They can still be assigned to safe function pointers and implement the appropriate `Fn*` traits.
    
    ```rust
    #[target_feature(enable = "avx2")]
    fn qux() {
        let my_closure = || avx2(); // this call to `avx2` is safe
        let f: fn() = my_closure;
    }
    ```
    
    This means that in order to call a function with `#[target_feature]`, you must show that the target-feature is available while the function executes *and* for as long as whatever may escape from that function lives.
    
    ### Documentation
    
    - Reference: rust-lang/reference#1181
    
    ---
    cc tracking issue rust-lang#69098
    r? ``@ghost``
    Dylan-DPC authored Feb 27, 2023
    Configuration menu
    Copy the full SHA
    33af22a View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#104265 - faern:move-ipaddr-to-core, r=josht…

    …riplett
    
    Move IpAddr, SocketAddr and V4+V6 related types to `core`
    
    Implements RFC rust-lang/rfcs#2832. The RFC has completed FCP with disposition merge, but is not yet merged.
    
    Moves IP types to `core` as specified in the RFC.
    
    The full list of moved types is: `IpAddr`, `Ipv4Addr`, `Ipv6Addr`, `SocketAddr`, `SocketAddrV4`, `SocketAddrV6`, `Ipv6MulticastScope` and `AddrParseError`.
    
    Doing this move was one of the main driving arguments behind rust-lang#78802.
    Dylan-DPC authored Feb 27, 2023
    Configuration menu
    Copy the full SHA
    0b93a27 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#108326 - tmiasko:read-buf, r=thomcc

    Implement read_buf for a few more types
    
    Implement read_buf for TcpStream, Stdin, StdinLock, ChildStdout,
    ChildStderr (and internally for AnonPipe, Handle, Socket), so
    that it skips buffer initialization.
    
    The other provided methods like read_to_string and read_to_end are
    implemented in terms of read_buf and so benefit from the optimization
    as well.
    
    This commit also implements read_vectored and is_read_vectored where
    applicable.
    Dylan-DPC authored Feb 27, 2023
    Configuration menu
    Copy the full SHA
    4593429 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#108405 - Nilstrieb:lazy-crate-name-optimiza…

    …tion-fuel, r=WaffleLapkin
    
    Lazily compute crate name for consider_optimizing
    
    The extra query is unnecessary in the common case of not having fuel.
    Dylan-DPC authored Feb 27, 2023
    Configuration menu
    Copy the full SHA
    8d77c03 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#108523 - TaKO8Ki:avoid-str-to-string-conver…

    …sions, r=Nilstrieb
    
    Avoid `&str` to `String` conversions
    
    This patch removes some unnecessary `&str` to `String` conversions.
    Dylan-DPC authored Feb 27, 2023
    Configuration menu
    Copy the full SHA
    18d4a7f View commit details
    Browse the repository at this point in the history