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 #83360

Merged
merged 24 commits into from
Mar 22, 2021
Merged

Rollup of 9 pull requests #83360

merged 24 commits into from
Mar 22, 2021

Commits on Jan 7, 2021

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

Commits on Feb 26, 2021

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

Commits on Mar 1, 2021

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

Commits on Mar 4, 2021

  1. slice: Stabilize IterMut::as_slice.

    Much like rust-lang#72584.
    
    As per rust-lang#58957 there's no blocker for this, and I wanted to use this
    today :-)
    emilio committed Mar 4, 2021
    Configuration menu
    Copy the full SHA
    5176f67 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2021

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

Commits on Mar 20, 2021

  1. Move debuginfo docs from doc.rs module to doc.md file

    And use `#[doc = include_str!("doc.md")]` in `mod.rs` so the docs are
    rendered as if they were inline in the root module.
    camelid committed Mar 20, 2021
    Configuration menu
    Copy the full SHA
    a2e9374 View commit details
    Browse the repository at this point in the history
  2. Cleanup LLVM debuginfo module docs

    * Use Markdown list syntax and unindent a bit to prevent Markdown
      interpreting the nested lists as code blocks
    * A few more small typographical cleanups
    camelid committed Mar 20, 2021
    Configuration menu
    Copy the full SHA
    dc240fa View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2021

  1. Download a more recent LLVM version if src/version is modified

    When bumping the bootstrap version, the name of the generated LLVM
    shared object file is changed, even though it's the same contents as
    before. If bootstrap tries to use an older version, it will get linking
    errors:
    
    ```
    Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
       Compiling rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-Wl,--as-needed" ... lots of args ...
      = note: /usr/bin/ld: cannot find -lLLVM-12-rust-1.53.0-nightly
              clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    error: could not compile `rustdoc-tool`
    ```
    jyn514 committed Mar 21, 2021
    Configuration menu
    Copy the full SHA
    4002171 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0acdada View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    236c0cf View commit details
    Browse the repository at this point in the history
  4. use BITS constant

    the8472 committed Mar 21, 2021
    Configuration menu
    Copy the full SHA
    1438207 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    895d7a9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    08a1dd2 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    bfae41d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2bd7c1b View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2021

  1. Rollup merge of rust-lang#80193 - zseri:stabilize-osstring-ascii, r=m…

    …-ou-se
    
    stabilize `feature(osstring_ascii)`
    
    This PR stabilizes `feature(osstring_ascii)`.
    
    Fixes rust-lang#70516.
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    e9398bc View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#80771 - thomcc:nonnull-refmut, r=dtolnay

    Make NonNull::as_ref (and friends) return refs with unbound lifetimes
    
    # Rationale:
    
    1. The documentation for all of these functions claims that this is what the functions already do, as they all come with this comment:
    
        > You must enforce Rust's aliasing rules, *since the returned lifetime 'a is arbitrarily chosen* and does not necessarily reflect the actual lifetime of the data...
    
        So I think it's just a bug that they weren't this way already. Note that had it not been for this part, I wouldn't be making this PR, so if we decide we won't take this change, I'll follow it up with a docs PR to fix this.
    
    2. This is how the equivalent raw pointer functions behave.
    
        They also take `self` and not `&self`/`&mut self`, but that can't be changed compatibly at this point. This is the next best thing.
    
    3. Without this fix, often code that uses these methods will find it has to expand the lifetime of the result.
    
        (I can't speak for others but even in unsafe-heavy code, needing to do this unexpectedly is a huge red flag -- if Rust thinks something should have a specific lifetime, I assume it's for a reason)
    
    ### Can this cause existing code to be unsound?
    
    I'm confident this can't cause new unsoundness since the reference exists for at most its lifetime, but you get a borrow checker error if you do something that would require/allow the reference to exist past its lifetime.
    
    Additionally, the aliasing rules of a reference only applies while the reference exists.
    
    This *must* be the case, as it is required by the rules used by safe code. (That said, the documentation in this file sort of contradicts it, but I think it's just ambiguity between the lifetime `'a` in `&'a T` and lifetime of the `&'a T` reference itself...)
    
    We are increasing the lifetime of these references, but they should already have hard bounds on that lifetime, or they'd have borrow checker errors.
    
    (CC ``@RalfJung`` because I have gone and done the mistake where I say something definitive about aliasing in Rust which is honestly outside the group of things I should make definitive comments about).
    
    # Caveats
    
    1. This is insta-stable (except for on the unstable functions ofc). I don't think there's any other alternative.
    
    2. I don't believe this is a breaking change in practice. In theory someone could be assigning `NonNull::as_ref` to a function pointer of type `fn(&NonNull<T>) -> &T`. Now they'd need to use a slightly different function pointer type which is (probably) incompatible. This seems pathological, but I guess crater could be used if there are concerns.
    
    3. This has no tests. The old version didn't either that I saw. I could add some stuff that fails to compile without it, if that would be useful.
    
    4. Sometimes the NLL borrow checker gives up and decides lifetimes live till the end of the scope, as opposed to the range where they're used. If this change can cause this to happen more, then my soundness rationale is wrong, and it's likely breaking.
    
        In practice this seems super unlikely.
    
    Anyway. That was a lot of typing.
    
    Fixes rust-lang#80183
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    ad8aa18 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#81607 - the8472:trustedrandomaccess-all-the…

    …-things, r=m-ou-se
    
    Implement TrustedLen and TrustedRandomAccess for Range<integer>, array::IntoIter, VecDequeue's iterators
    
    This should make some `FromIterator` and `.zip()` specializations applicable in a few more cases.
    
    ``@rustbot`` label libs-impl
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    29a53e6 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#82554 - SkiFire13:fix-string-retain-unsound…

    …ness, r=m-ou-se
    
    Fix invalid slice access in String::retain
    
    As noted in rust-lang#78499, the previous fix was technically still unsound because it accessed elements of a slice outside its bounds (even though they were still inside the same allocation). This PR addresses that concern by switching to a dropguard approach.
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    da143d3 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#82686 - CDirkx:unix-platform, r=m-ou-se

    Move `std::sys::unix::platform` to `std::sys::unix::ext`
    
    This moves the operating system dependent alias `platform` (`std::os::{linux, android, ...}`) from `std::sys::unix` to `std::sys::unix::ext` (a.k.a. `std::os::unix`), removing the need for compatibility code in `unix_ext` when documenting on another platform.
    
    This is also a step in making it possible to properly move `std::sys::unix::ext` to `std::os::unix`, as ideally `std::sys` should not depend on the rest of `std`.
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    c66d66e View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#82771 - emilio:iter-mut-as-slice, r=m-ou-se

    slice: Stabilize IterMut::as_slice.
    
    Much like rust-lang#72584.
    
    As per rust-lang#58957 there's no blocker for this, and I wanted to use this
    today :-)
    
    Closes rust-lang#58957
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    34285de View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#83329 - camelid:debuginfo-doc-cleanup, r=da…

    …vidtwco
    
    Cleanup LLVM debuginfo module docs
    
    - Move debuginfo docs from `doc.rs` module to `doc.md` file
    - Cleanup LLVM debuginfo module docs
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    85f16fb View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#83336 - camelid:tool-mod-ice, r=petrochenkov

    Fix ICE with `use clippy::a::b;`
    
    Fixes rust-lang#83317.
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    ea5ba76 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#83350 - jyn514:llvm-version, r=Mark-Simulacrum

    Download a more recent LLVM version if `src/version` is modified
    
    When bumping the bootstrap version, the name of the generated LLVM
    shared object file is changed, even though it's the same contents as
    before. If bootstrap tries to use an older version, it will get linking
    errors:
    
    ```
    Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
       Compiling rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-Wl,--as-needed" ... lots of args ...
      = note: /usr/bin/ld: cannot find -lLLVM-12-rust-1.53.0-nightly
              clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    error: could not compile `rustdoc-tool`
    ```
    
    Helps with rust-lang#81930.
    Dylan-DPC authored Mar 22, 2021
    Configuration menu
    Copy the full SHA
    790c2ad View commit details
    Browse the repository at this point in the history