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 18 pull requests #74308

Closed
wants to merge 81 commits into from

Commits on May 31, 2020

  1. Substantial refactor to the design of LineWriter

    This commit redesigns LineWriter to work more directly on the internals
    of BufWriter. This interface change is to enable a future Pull Request
    in which Stdout can be switched between Line and Block buffered mode.
    Lucretiel committed May 31, 2020
    Configuration menu
    Copy the full SHA
    37570e8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f38158 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4a1597f View commit details
    Browse the repository at this point in the history
  4. Expressionify write_all

    Lucretiel committed May 31, 2020
    Configuration menu
    Copy the full SHA
    5edad37 View commit details
    Browse the repository at this point in the history
  5. x.py fmt

    Lucretiel committed May 31, 2020
    Configuration menu
    Copy the full SHA
    1bf8ba3 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2020

  1. Configuration menu
    Copy the full SHA
    e0dfdc6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2c3024b View commit details
    Browse the repository at this point in the history
  3. Added test stubs

    Lucretiel committed Jun 1, 2020
    Configuration menu
    Copy the full SHA
    e89e2e4 View commit details
    Browse the repository at this point in the history
  4. Various testing & implementation updates:

    - Added a bunch of new unit tests
    - Removed test_line_buffer_fail_flush
    - Updated erroneous_flush_retried
    - Added helper methods to LineWriterShim for code clarity, to distinguish "self.buffer" (the BufWriter) from self.inner (the thing wrapped by the BufWriter)
    - Un-expressionized write & write_all
    - Added clause to bail early on Ok(0)
    Lucretiel committed Jun 1, 2020
    Configuration menu
    Copy the full SHA
    f0a0807 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2020

  1. Tons of testing updates, other minor changes

    - Cleaned up BufWriter::seek
    - Updated line_vectored test
    - Updated line_vectored_partial_and_errors test
    - Added several new tests
    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    b6296e8 View commit details
    Browse the repository at this point in the history
  2. Fixed typo in test

    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    e022d34 View commit details
    Browse the repository at this point in the history
  3. Code review updates: all minor style fixes

    - Renamed write_to_buffer to write_to_buf, for consistency
    - Fixed references to flush_buf
    - Optimized `write` to use one less `memchr` call
    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    e4328ae View commit details
    Browse the repository at this point in the history
  4. Add comment

    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    f7650fe View commit details
    Browse the repository at this point in the history
  5. Tidy fixes

    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    7a6a12b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    338a2c0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c869638 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    61f591e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2d22c77 View commit details
    Browse the repository at this point in the history
  10. Comment updates

    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    2c23b90 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e999ca5 View commit details
    Browse the repository at this point in the history
  12. More minor changes

    - Fixed test after write_vectored bugfix
    - Some comments
    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    70ba320 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    5b1a40c View commit details
    Browse the repository at this point in the history
  14. x.py fix AGAIN

    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    8df5ae0 View commit details
    Browse the repository at this point in the history
  15. Fixed corner case related to partial-line buffering

    - Fixed partial-line buffering issue
    - Added tests
    
    Thanks @the8472 for catching!
    Lucretiel committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    60ab99f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    38017a3 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    59710fb View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2020

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

Commits on Jun 30, 2020

  1. Clarify some parts by applying the suggestions from review

    Co-authored-by: Josh Triplett <josh@joshtriplett.org>
    poliorcetics and joshtriplett committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    614f773 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2020

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

Commits on Jul 5, 2020

  1. Configuration menu
    Copy the full SHA
    c478b54 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b1d5e6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    90580c7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5f5c98b View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2020

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

Commits on Jul 8, 2020

  1. rustdoc: Allow linking from private items to private types

    Fixes rust-lang#74134
    
    After PR rust-lang#72771 this would trigger an intra_doc_link_resolution_failure warning
    when rustdoc is invoked without --document-private-items. Links from private
    items to private types are however never actually generated in that case and
    thus shouldn't produce a warning. These links are in fact a very useful tool to
    document crate internals.
    
    Tests are added for all 4 combinations of public/private items and link
    targets. Test 1 is the case mentioned above and fails without this commit. Tests
    2 - 4 passed before already but are added nonetheless to prevent regressions.
    dennis-hamester committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    c8b16cd View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2020

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

Commits on Jul 11, 2020

  1. test: rustdoc-ui: Add issue-74134, replacing test/rustdoc/issue-74134-*

    As per the discussion in PR rust-lang#74147, the 4 individual tests are replaced by a
    single one.
    
    The test is expanded to cover all 4 public/private cases, each with and without
    --document-private-items.
    dennis-hamester committed Jul 11, 2020
    Configuration menu
    Copy the full SHA
    689e360 View commit details
    Browse the repository at this point in the history
  2. Removed FIXME

    Lucretiel committed Jul 11, 2020
    Configuration menu
    Copy the full SHA
    b8632e1 View commit details
    Browse the repository at this point in the history
  3. Removed another FIXME

    Lucretiel committed Jul 11, 2020
    Configuration menu
    Copy the full SHA
    140bfc5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9704859 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8789525 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0979545 View commit details
    Browse the repository at this point in the history
  7. Improve wording

    GuillaumeGomez committed Jul 11, 2020
    Configuration menu
    Copy the full SHA
    4728438 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    997accc View commit details
    Browse the repository at this point in the history
  9. Removed unused method

    Lucretiel committed Jul 11, 2020
    Configuration menu
    Copy the full SHA
    6a7b5df View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    905b5ad View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2020

  1. Minor updates

    - Remove outdated comment
    - Refactor flush-retry behavior into its own method
    - Some other comment updates
    Lucretiel committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    606593f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8082fb9 View commit details
    Browse the repository at this point in the history
  3. adjust remaining targets

    RalfJung committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    7dc3886 View commit details
    Browse the repository at this point in the history
  4. assign tracking issue

    RalfJung committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    ff5e107 View commit details
    Browse the repository at this point in the history
  5. typeck: report placeholder type error w/out span

    This commit fixes a regression introduced in rust-lang#70369 which
    meant that an error was not being emitted for invalid placeholder types
    when there wasn't a span available.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    5afbc52 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5daedea View commit details
    Browse the repository at this point in the history
  7. Update RELEASES.md for 1.45.0

    XAMPPRocky authored and Mark-Simulacrum committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    ffac887 View commit details
    Browse the repository at this point in the history
  8. Clean up handling of style files in rustdoc

    Disable all themes other than `light.css` to prevent rule conflicts
    Cldfire committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    0e89f50 View commit details
    Browse the repository at this point in the history
  9. Add Ayu theme to rustdoc

    Cldfire committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    8c45cf8 View commit details
    Browse the repository at this point in the history
  10. Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit whi…

    …ch includes LVI segfault fix
    AdrianCX authored and Adrian Cruceru committed Jul 12, 2020
    Configuration menu
    Copy the full SHA
    ed587f8 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2020

  1. Teach bootstrap about target files vs target triples

    `rustc` allows passing in predefined target triples as well as JSON
    target specification files. This change allows bootstrap to have the
    first inkling about those differences. This allows building a
    cross-compiler for an out-of-tree architecture (even though that
    compiler won't work for other reasons).
    
    Even if no one ever uses this functionality, I think the newtype
    around the `Interned<String>` improves the readability of the code.
    shepmaster committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    c24b96d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9a3a31a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ff7e1a View commit details
    Browse the repository at this point in the history
  4. Removed trailing whitespace

    theo-lw committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    eac8092 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e3ae4c7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bc2b37a View commit details
    Browse the repository at this point in the history
  7. Remove trailing whitespace

    theo-lw committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    8df79fc View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#71237 - Cldfire:rustdoc-ayu-theme, r=Guilli…

    …aumeGomez
    
    Add Ayu theme to rustdoc
    
    This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.
    
    Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).
    
    Some screenshots:
    
    ![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png)
    
    ![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png)
    
    ![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png)
    
    ![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png)
    
    ![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png)
    
    Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    d0ec58c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#72808 - Lucretiel:line-writer-reimpl, r=Ama…

    …nieu
    
    Substantial refactor to the design of LineWriter
    
    # Preamble
    
    This is the first in a series of pull requests designed to move forward with rust-lang#60673 (and the related [5 year old FIXME](https://github.com/rust-lang/rust/blob/ea7181b5f7a888c2cf969ae86de7207fa5fb40aa/src/libstd/io/stdio.rs#L459-L461)), which calls for an update to `Stdout` such that it can be block-buffered rather than line-buffered under certain circumstances (such as a `tty`, or a user setting the mode with a function call). This pull request refactors the logic `LineWriter` into a `LineWriterShim`, which operates on a `BufWriter` by mutable reference, such that it is easy to invoke the line-writing logic on an existing `BufWriter` without having to construct a new `LineWriter`.
    
    Additionally, fixes rust-lang#72721
    
    ## A note on flushing
    
    Because the word **flush** tends to be pretty overloaded in this discussion, I'm going to use the word **unbuffered** to refer to a `BufWriter` sending its data to the wrapped writer via `write`, without calling `flush` on it, and I'll be using **flushed** when referring to sending data via flush, which recursively writes the data all the way to the final sink.
    
    For example, given a `T = BufWriter<BufWriter<File>>`, saying that `T` **unbuffers** its data means that it is sent to the inner `BufWriter`, but not necessarily to the `File`, whereas saying that `T` **flushes** its data means that causes it (via `Write::flush`) to be delivered all the way to `File`.
    
    # Goals
    
    Once it became clear (for reasons described below) that the best way to approach this would involve refactoring `LineWriter` to work more directly on `BufWriter`'s internals, I established the following design goals for the refactor:
    
    - Do not duplicate logic with `BufWriter`. It's great at buffering and then unbuffering data, so use the existing logic as much as possible.
    - Minimize superfluous copying of data into `BufWriter`'s buffer.
    - Eliminate calls to `BufWriter::flush` and instead do the same thing as `BufWriter::write`, which is to only write to the wrapped writer (rather than flushing all the way down to the final data sink).
    - Uphold the "at-most 1 write of new data" convention of `Write::write`
    - Minimize or eliminate dropping errors (that is, eliminate the parts of the old design that threw away errors because `write` *must* report if any bytes were written)
    - As much as possible, attempt to fully flush completed lines, and *not* flush partial lines. One of the advantages of this design is that, so long as we don't encounter lines larger than the `BufWriter`'s capacity, partial lines will never be unbuffered, while completed lines will *always* be unbuffered (with subsequent calls to `LineWriter::write` retrying failed writes before processing new data.
    
    # Design
    
    There are two major & related parts of the design.
    
    First, a new internal stuct, `LineWriterShim`, is added. This struct implements all of the actual logic of line-writing in a `Write` implementation, but it only operates on an `&mut BufWriter`. This means that this shim can be constructed on-the-fly to apply line writing logic to an existing `BufWriter`. This is in fact how `LineWriter` has been updated to operate, and it is also how `Stdout` is being updated in my [development branch](https://github.com/Lucretiel/rust/tree/stdout-block-buffer) to switch which mode it wants to use at runtime.
    
    [An example of how this looks in practice](https://github.com/Lucretiel/rust/blob/f24f272df674dc7fa8941b97b45f41ad08b2199b/src/libstd/io/stdio.rs#L479-L484
    )
    
    The second major part of the design that the line-buffering logic, implemented in `LineWriterShim`, has been updated to work slightly more directly on the internals of `BufWriter`. Mostly it makes us of the public interface—particularly `buffer()` and `get_mut()`—but it also controls the flushing of the buffer with `flush_buf` rather than `flush`, and it writes to the buffer infallibly with a new `write_to_buffer` method. This has several advantages:
    
    - Data no longer has to round trip through the `BufWriter`'s buffer. If the user provides a complete line, that line is written directly to the inner writer (after ensuring the existing buffer is flushed).
    - The conventional contract of `write`—that at-most 1 attempt to write new data is made—is much more cleanly upheld, because we don't have to perform fallible flushes and perform semi-complicated logic of trying to pretend errors at different stages didn't happen. Instead, after attempting to write lines directly to the buffer, we can infallibly add trailing data to the buffer without allowing any attempts to continue writing it to the `inner` writer.
    - Perhaps most importantly, `LineWriter` *no longer performs a full flush on every line.* This makes its behavior much more consistent with `BufWriter`, which unbuffers data to its inner writer, without trying to flush it all the way to the final device. Previously, `LineWriter` had no choice but to use `flush` to ensure that the lines were unbuffered, but by writing directly to `inner` via `get_mut()` (when appropriate), we can use a more correct behavior.
    
    ## New(ish) line buffering logic
    
    The logic for line writing has been cleaned up, as described above. It now follows this algorithm for `write`, with minor adjustments for `write_all` and `write_vectored`:
    
    - Does our input data contain a newline?
        - If no:
            - simply use the regular `BufWriter::write` to write it; this will append it to the buffer and/or flush it as necessary based on how full the buffer is and how much input data there is.
            - additionally, if the current buffer ends with `'\n'`, attempt to immediately flush it with `flush_buf` before calling `BufWriter::write` This reproduces the old `needs_flush` behavior and ensures completed lines are flushed as soon as possible. The reason we only check if the buffer *ends* with `'\n'` is discussed later.
        - If yes:
            - First, `flush_buf`
            - Then use `bufwriter.get_mut().write()` to write the input data directly to the underlying writer, up to the last newline. Make at most one attempt at this.
            - If it errors, return the error
            - If it succeeds with a full write, add the remaining data (between the last newline and the end of the input) to the buffer. In order to uphold the "at-most 1 attempt to write new data" convention, no attempts are made to write this data to the inner writer (though obviously a subsequent write may immediately flush it, e.g., if it totally filled the buffer's capacity.
            - If it only partially succeeds, buffer the data only up to the last newline. We do this to try to avoid writing partial lines to the inner writer where possible (that is, whenever the lines are shorter than the total buffer capacity).
    
    While it was not my intention for this behavior to diverge from this existing `LineWriter` algorithm, this updated design emerged very naturally once `LineWriter` wasn't burdened with having to only operate via `BufWriter::flush`. There essentially two main changes to observable behavior:
    
    - `flush` is no longer used to unbuffer lines. The are only written to the writer wrapped by `LineWriter`; this inner writer might do its own buffering. This change makes `LineWriter` consistent with the behavior of `BufWriter`. This is probably the most obvious user-visible change; it's the one I most expect to provoke issue reports, if any are provoked.
    - Unless a line exceeds the capacity of the buffer, partial lines are not unbuffered (without the user manually calling flush). This is a less surprising behavior, and is enabled because `LineWriter` now has more precise control of what data is buffered and when it is unbuffered. I'd be surprised if anyone is relying on `LineWriter` unbuffering or flushing *partial* lines that are shorter than the capacity, so I'm not worried about this one.
    
    None of these changes are inconsistent with any published documentation of `LineWriter`. Nonetheless, like all changes with user-facing behavior changes, this design will obviously have to be very carefully scrutinized.
    
    # Alternative designs and design rationalle
    
    The initial goal of this project was to provide a way for the `LineWriter` logic to be operable directly on a `BufWriter`, so that the updated `Stdout` doesn't need to do something convoluted like `enum { BufWriter, LineWriter }` (which ends up being ~~impossible~~ difficult to transition between states after being constructed). The design went through several iterations before arriving at the current draft.
    
    The major first version simply involved adding methods like `write_line_buffered` to `BufWriter`; these would contain the actual logic of line-buffered writing, and would additionally have the advantages (described above) of operating directly on the internals of `BufWriter`. The idea was that `LineWriter` would simply call these methods, and the updated `Stdout` would use either `BufWriter::write` or `BufWriter::write_line_buffered`, depending on what mode it was in.
    
    The major issue with this design is that it loses the ability to take advantage of the `io::Write` trait, which provides several useful default implementations of the various io methods, such as `write_fmt` and `write_all`, just using the core methods. For this reason, the `write_line_buffered` design was retained, but moved into a separate struct called `LineWriterShim` which operates on an `&mut LineWriter`. As part of this move, the logic was lightly retooled to not touch the innards of `BufWriter` directly, but instead to make use of the unexported helper methods like `flush_buf`.
    
    The other design evolutions were mostly related to answering questions like "how much data should be buffered", "how should partial line writes be handled", etc. As much as possible I tried to answer these by emulating the current `LineWriter` logic (which, for example, retries partial line writes on subsequent calls to `write`) while still meeting the refactor design goals.
    
    # Next steps
    
    ~Currently, this design fails a few `LineWriter` tests, mostly because they expect `LineWriter` to *fully* flush its content. There are also some changes to the way that `LineWriter` buffers data *after* writing completed lines, aimed at ensuring that partial lines are not unbuffered prematurely. I want to make sure I fully understand the intent behind these tests before I either update the test or update this design so that they pass.~
    
    However, in the meantime I wanted to get this published so that feedback could start to accumulate on it. There's a lot of errata around how I arrived at this design that didn't really fit in this overlong document, so please ask questions about anything that confusing or unclear and hopefully I can explain more of the rationale that led to it.
    
    # Test updates
    
    This design required some tests to be updated; I've research the intent behind these tests (mostly via `git blame`) and updated them appropriately. Those changes are cataloged here.
    
    - `test_line_buffer_fail_flush`: This test was added as a regression test for rust-lang#32085, and is intended to assure that an errors from `flush` aren't propagated when preceded by a successful `write`. Because type of issue is no longer possible, because `write` calls `buffer.get_mut().write()` instead of `buffer.write(); buffer.flush();`, I'm simply removing this test entirely. Other, similar error invariants related to errors during write-retrying are handled in other test cases.
    - `erroneous_flush_retried`: This test was added as a regression test for rust-lang#37807, and was intended to ensure that flush-retrying (via `needs_flush`) and error-ignoring were being handled correctly (ironically, this issue was caused by the flush-error-ignoring, above). Half of that issue is not possible by design with this refactor, because we no longer make fallible i/o calls that might produce errors we have to ignore after unbuffering lines. The `should_flush` behavior is captured by checking for a trailing newline in the `LineWriter` buffer; this test now checks that behavior.
    - `line_vectored`: changes here were pretty minor, mostly related to when partial lines are or aren't written. The old implementation of `write_vectored` used very complicated logic to precisely determine the location of the last newline and precisely write up to that point; this required doing several consecutive fallible writes, with all the complex error handling or ignoring issues that come with it. The updated design does at-most one write of a subset of total buffers (that is, it doesn't split in the middle of a buffer), even if that means writing partial lines. One of the major advantages of the new design is that the underlying vectored write operation on the device can be taken advantage of, even with small writes, so long as they include a newline; previously these were unconditionally buffered then written.
    - `line_vectored_partial_and_errors`: Pretty similiar to `line_vectored`, above; this test is for basic error recovery in `write_vectored` for vectored writes. As previously discussed, the mocked behavior being tested for (errors ignored under certain circumstances) no occurs, so I've simplified the test while doing my best to retain its spirit.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    ce04962 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73354 - XAMPPRocky:relnotes-1.45.0, r=Mark-…

    …Simulacrum
    
    Update RELEASES.md for 1.45.0
    
    ### [Rendered](https://github.com/XAMPPRocky/rust/blob/relnotes-1.45.0/RELEASES.md)
    
    r? @Mark-Simulacrum
    cc @rust-lang/release
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    70ea364 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#73852 - euclio:rustdoc-attr-newlines, r=Gui…

    …llaumeGomez
    
    rustdoc: insert newlines between attributes
    
    Fixes rust-lang#73205.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    2481ade View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#73867 - poliorcetics:union-keyword, r=josht…

    …riplett
    
    Document the union keyword
    
    Partial fix of rust-lang#34601.
    
    This documents the `union` keyword by presenting three cases: simply using a union, matching on a union and referencing the fields of a union.
    
    @rustbot modify labels: T-doc,C-enhancement
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    0663d5e View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#73986 - RalfJung:raw-slice-as-ptr, r=sfackler

    add (unchecked) indexing methods to raw (and NonNull) slices
    
    This complements the existing (unstable) `len` method. Unfortunately, for non-null slices, we cannot call this method `as_ptr` as that overlaps with the existing method of the same name.
    
    If this looks reasonable to accept, I propose to reuse the rust-lang#71146 tracking issue and rename the feature get to `slice_ptr_methods` or so.
    
    Cc @SimonSapin
    Fixes rust-lang#60639
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    51a8ce1 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#74046 - ehuss:deny-warnings-caching, r=Mark…

    …-Simulacrum
    
    Fix caching issue when building tools.
    
    This fixes a problem with tool builds not being cached properly.
    
    rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.
    
    The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.
    
    Alternate solutions:
    * Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
    * Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
      * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
    * Teach Cargo to add flags to the workspace members, but not dependencies.
    * Teach Cargo to add flags without fingerprinting them?
    * Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
    * Teach Cargo about lint settings.
    
    Closes rust-lang#74016
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    1b0c024 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#74123 - GuillaumeGomez:cleanup-e0718, r=pic…

    …kfire
    
    clean up E0718 explanation
    
    r? @Dylan-DPC
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    3282046 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#74147 - dennis-hamester:fix/issue-74134, r=…

    …jyn514
    
    rustdoc: Allow linking from private items to private types
    
    Fixes rust-lang#74134
    
    After PR rust-lang#72771 this would trigger an intra_doc_link_resolution_failure warning
    when rustdoc is invoked without --document-private-items. Links from private
    items to private types are however never actually generated in that case and
    thus shouldn't produce a warning. These links are in fact a very useful tool to
    document crate internals.
    
    Tests are added for all 4 combinations of public/private items and link
    targets. Test 1 is the case mentioned above and fails without this commit. Tests
    2 - 4 passed before already but are added nonetheless to prevent regressions.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    75517fb View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#74173 - estebank:struct-pat-as-enum, r=petr…

    …ochenkov
    
    Detect tuple struct incorrectly used as struct pat
    
    Subpart of rust-lang#74005.
    
    r? @petrochenkov
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    7913222 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#74227 - erikdesjardins:layun, r=estebank

    Remove an unwrap in layout computation
    
    A tiny improvement.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    206a09a View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#74239 - AdrianCX:master, r=cuviper

    Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit
    
    which includes LVI segfault fix when building fortanix/rust-sgx#267
    And a few earlier commits.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    bd2d6d8 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#74251 - shepmaster:bootstrap-target-files, …

    …r=Mark-Simulacrum
    
    Teach bootstrap about target files vs target triples
    
    `rustc` allows passing in predefined target triples as well as JSON
    target specification files. This change allows bootstrap to have the
    first inkling about those differences. This allows building a
    cross-compiler for an out-of-tree architecture (even though that
    compiler won't work for other reasons).
    
    Even if no one ever uses this functionality, I think the newtype
    around the `Interned<String>` improves the readability of the code.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    44eeb0e View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#74257 - alex:patch-1, r=joshtriplett

    don't mark linux kernel module targets as a unix environment
    
    refs rust-lang#74247
    
    r?@joshtriplett
    
    cc: @ehuss
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    7ff75b1 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#74263 - RalfJung:thread-local, r=Mark-Simul…

    …acrum
    
    Slight reorganization of sys/(fast_)thread_local
    
    I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor.
    
    So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    a539985 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#74270 - davidtwco:issue-74086-more-placehol…

    …der-type-error, r=estebank
    
    typeck: report placeholder type error w/out span
    
    Fixes rust-lang#74086.
    
    This PR fixes a regression introduced in rust-lang#70369 which meant that an error was not being emitted for invalid placeholder types when there wasn't a span available.
    
    r? @estebank
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    dac2909 View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#74285 - wangtheo:issue-71669, r=lcnr

    rust-lang#71669: add ui, codegen tests for volatile + nearby int intrinsics
    
    Added some tests for intrinsics. See rust-lang#71669.
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    0a7bbce View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#74286 - PankajChaudhary5:E0688, r=Guillaume…

    …Gomez
    
    Added detailed error code explanation for issue E0688 in Rust compiler.
    
    Added proper error explanation for issue E0688 in the Rust compiler.
    Error Code E0688
    
    Sub Part of Issue rust-lang#61137
    
    r? @GuillaumeGomez
    Manishearth committed Jul 13, 2020
    Configuration menu
    Copy the full SHA
    2f20d96 View commit details
    Browse the repository at this point in the history