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 7 pull requests #122176

Closed
wants to merge 33 commits into from

Commits on Dec 11, 2023

  1. Configuration menu
    Copy the full SHA
    547f3ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e9ca48 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2024

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

Commits on Feb 15, 2024

  1. Update library/std/src/fs.rs

    Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
    haydonryan and m-ou-se committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    9539feb View commit details
    Browse the repository at this point in the history
  2. Update library/std/src/fs.rs

    Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
    haydonryan and m-ou-se committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    b5e1ca3 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2024

  1. Configuration menu
    Copy the full SHA
    93fa857 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    040ab7d View commit details
    Browse the repository at this point in the history
  3. Use slice.chain(option) for Successors

    This makes more sense because most cases then second one is unwind target.
    nbdd0121 committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    7152993 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b044aaa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3b1dd1b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    27e6ee1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5e4fd6b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5e4e3d7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    31f078e View commit details
    Browse the repository at this point in the history
  10. Add tests for asm goto

    nbdd0121 committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    4677a71 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    84bc9e9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    626a5f5 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2024

  1. Fix quadratic behavior of repeated vectored writes

    Some implementations of `Write::write_vectored` in the standard
    library (`BufWriter`, `LineWriter`, `Stdout`, `Stderr`) check all
    buffers to calculate the total length. This is O(n) over the number of
    buffers.
    
    It's common that only a limited number of buffers is written at a
    time (e.g. 1024 for `writev(2)`). `write_vectored_all` will then call
    `write_vectored` repeatedly, leading to a runtime of O(n²) over the
    number of buffers.
    
    The fix is to only calculate as much as needed if it's needed.
    blyxxyz committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    8212fc5 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2024

  1. Configuration menu
    Copy the full SHA
    66147c8 View commit details
    Browse the repository at this point in the history
  2. Fix lint.

    reitermarkus committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    ba35507 View commit details
    Browse the repository at this point in the history
  3. Fix miri tests.

    reitermarkus committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    2fc73d3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    06992c7 View commit details
    Browse the repository at this point in the history
  5. Fix lint.

    reitermarkus committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    f4be633 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cc38c1e View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Bless aarch64 asm test

    nbdd0121 committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    0ee0f29 View commit details
    Browse the repository at this point in the history
  2. PassWrapper: update for llvm/llvm-project@a3319371970b

    @rustbot label: +llvm-main
    durin42 committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    ef626d7 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

  1. Rollup merge of rust-lang#118623 - haydonryan:master, r=workingjubilee

    Improve std::fs::read_to_string example
    
    Resolves  [rust-lang#118621](rust-lang#118621)
    
    For the original code to succeed it requires address.txt to contain a socketaddress, however it is much easier to follow if this is just any strong - eg address could be a street address or just text.
    
    Also changed the variable name from "foo" to something more meaningful as cargo clippy warns you against using foo as a placeholder.
    
    ```
    $ cat main.rs
    use std::fs;
    use std::error::Error;
    
    fn main() -> Result<(), Box<dyn Error>> {
        let addr: String = fs::read_to_string("address.txt")?.parse()?;
        println!("{}", addr);
        Ok(())
    }
    
    $ cat address.txt
    123 rusty lane
    san francisco 94999
    
    $ cargo run
        Finished dev [unoptimized + debuginfo] target(s) in 0.00s
         Running `/home/haydon/workspace/rust-test-pr/tester/target/debug/tester`
    123 rusty lane
    san francisco 94999
    
    ```
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    850b1d2 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#119365 - nbdd0121:asm-goto, r=Amanieu

    Add asm goto support to `asm!`
    
    Tracking issue: rust-lang#119364
    
    This PR implements asm-goto support, using the syntax described in "future possibilities" section of [RFC2873](https://rust-lang.github.io/rfcs/2873-inline-asm.html#asm-goto).
    
    Currently I have only implemented the `label` part, not the `fallthrough` part (i.e. fallthrough is implicit). This doesn't reduce the expressive though, since you can use label-break to get arbitrary control flow or simply set a value and rely on jump threading optimisation to get the desired control flow. I can add that later if deemed necessary.
    
    r? `@Amanieu`
    cc `@ojeda`
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    c0cb6ad View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#120608 - kornelski:slice-ptr-doc, r=cuviper

    Docs for std::ptr::slice_from_raw_parts
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    c68790e View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#121885 - reitermarkus:generic-nonzero-inner…

    …, r=oli-obk
    
    Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type.
    
    Tracking issue: rust-lang#120257
    
    r? `@dtolnay`
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    a0182c5 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#121938 - blyxxyz:quadratic-vectored-write, …

    …r=Amanieu
    
    Fix quadratic behavior of repeated vectored writes
    
    Some implementations of `Write::write_vectored` in the standard library (`BufWriter`, `LineWriter`, `Stdout`, `Stderr`) check all buffers to calculate the total length. This is O(n) over the number of buffers.
    
    It's common that only a limited number of buffers is written at a time (e.g. 1024 for `writev(2)`). `write_vectored_all` will then call `write_vectored` repeatedly, leading to a runtime of O(n²) over the number of buffers.
    
    This fix is to only calculate as much as needed if it's needed.
    
    Here's a test program:
    ```rust
    #![feature(write_all_vectored)]
    
    use std::fs::File;
    use std::io::{BufWriter, IoSlice, Write};
    use std::time::Instant;
    
    fn main() {
        let buf = vec![b'\0'; 100_000_000];
        let mut slices: Vec<IoSlice<'_>> = buf.chunks(100).map(IoSlice::new).collect();
        let mut writer = BufWriter::new(File::create("/dev/null").unwrap());
    
        let start = Instant::now();
        write_smart(&slices, &mut writer);
        println!("write_smart(): {:?}", start.elapsed());
    
        let start = Instant::now();
        writer.write_all_vectored(&mut slices).unwrap();
        println!("write_all_vectored(): {:?}", start.elapsed());
    }
    
    fn write_smart(mut slices: &[IoSlice<'_>], writer: &mut impl Write) {
        while !slices.is_empty() {
            // Only try to write as many slices as can be written
            let res = writer
                .write_vectored(slices.get(..1024).unwrap_or(slices))
                .unwrap();
            slices = &slices[(res / 100)..];
        }
    }
    ```
    Before this change:
    ```
    write_smart(): 6.666952ms
    write_all_vectored(): 498.437092ms
    ```
    After this change:
    ```
    write_smart(): 6.377158ms
    write_all_vectored(): 6.923412ms
    ```
    
    `LineWriter` (and by extension `Stdout`) isn't fully repaired by this because it looks for newlines. I could open an issue for that after this is merged, I think it's fixable but not trivially.
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    c7cd3b5 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#122099 - Urgau:btreemap-inline-new, r=Amanieu

    Add  `#[inline]` to `BTreeMap::new` constructor
    
    This PR add the `#[inline]` attribute to `BTreeMap::new` constructor as to make it eligible for inlining.
    
    <details>
    
    For some context: I was profiling `rustc --check-cfg` with callgrind and due to the way we currently setup all the targets and we end-up calling `BTreeMap::new` multiple times for (nearly) all the targets. Adding the `#[inline]` attribute reduced the number of instructions needed.
    
    </details>
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    e2283aa View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#122143 - durin42:llvm-19-compression-option…

    …s, r=workingjubilee
    
    PassWrapper: update for llvm/llvm-project@a3319371970b
    
    `@rustbot` label: +llvm-main
    matthiaskrgr committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    df4aed1 View commit details
    Browse the repository at this point in the history