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 6 pull requests #128879

Closed
wants to merge 19 commits into from

Commits on Aug 8, 2024

  1. Add Steal::is_stolen()

    Nadrieril committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    09ae438 View commit details
    Browse the repository at this point in the history
  2. Tweak wording

    Co-authored-by: lcnr <rust@lcnr.de>
    Nadrieril and lcnr committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    c966370 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Configuration menu
    Copy the full SHA
    11b801b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a3f8edf View commit details
    Browse the repository at this point in the history
  3. fix format

    MinxuanZ committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    625432c View commit details
    Browse the repository at this point in the history
  4. delete space

    MinxuanZ committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    0106f5b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b589f86 View commit details
    Browse the repository at this point in the history
  6. hir_typeck: use end_point over BytePos manipulations

    Parser has error recovery for Unicode-confusables, which includes the
    right parentheses `)`. If a multi-byte right parentheses look-alike
    reaches the argument removal suggestion diagnostics, it would trigger an
    assertion because the diagnostics used `- BytePos(1)` which can land
    within a multi-byte codepoint.
    
    This is fixed by using `SourceMap::end_point` to find the final right
    delimiter codepoint, which correctly respects codepoint boundaries.
    jieyouxu committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    879bfd7 View commit details
    Browse the repository at this point in the history
  7. tests: add regression test for rust-lang#128845

    For codepoint boundary assertion triggered by a let stmt compound
    assignment removal suggestion when encountering recovered multi-byte
    compound ops.
    
    Issue: <rust-lang#128845>
    jieyouxu committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    92520a9 View commit details
    Browse the repository at this point in the history
  8. parser: ensure let stmt compound assignment removal suggestion respec…

    …t codepoint boundaries
    
    Previously we would try to issue a suggestion for `let x <op>= 1`, i.e.
    a compound assignment within a `let` binding, to remove the `<op>`. The
    suggestion code unfortunately incorrectly assumed that the `<op>` is an
    exactly-1-byte ASCII character, but this assumption is incorrect because
    we also recover Unicode-confusables like `➖=` as `-=`. In this example,
    the suggestion code used a `+ BytePos(1)` to calculate the span of the
    `<op>` codepoint that looks like `-` but the mult-byte Unicode
    look-alike would cause the suggested removal span to be inside a
    multi-byte codepoint boundary, triggering a codepoint boundary
    assertion.
    
    Issue: <rust-lang#128845>
    jieyouxu committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    d65f131 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    38874a6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f72cb04 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a380d5e View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#128815 - Nadrieril:is_stolen, r=jieyouxu,lcnr

    Add `Steal::is_stolen()`
    
    Writers of rustc drivers (such as myself) often encounter stealing issues. It is currently impossible to gracefully handle them. This PR adds a `Steal::is_stolen()` function for that purpose.
    matthiaskrgr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    40db4e7 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#128852 - folkertdev:multipart-suggestion-st…

    …able-sort, r=compiler-errors
    
    use stable sort to sort multipart diagnostics
    
    I think a stable sort should be used to sort the different parts of a multipart selection. The current unstable sort uses the text of the suggestion as a tie-breaker. That just doesn't seem right, and the order of the input is a better choice I think, because it gives the diagnostic author more control.
    
    This came up when I was building a suggestion where
    
    ```rust
    fn foo() {}
    ```
    
    must be turned into an unsafe function, and an attribute must be added
    
    ```rust
    #[target_feature(enable = "...")]
    unsafe fn foo() {}
    ```
    
    In this example, the two suggestions occur at the same position, but the order is extremely important: unsafe must come after the attribute. But the situation changes if there is a pub/pub(crate), and if the unsafe is already present. It just out that because of the suggestion text, there is no way for me to order the suggestions correctly.
    
    This change probably should be tested, but are there tests of the diagnostics code itself in the tests?
    
    r? `@estebank`
    matthiaskrgr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    44db568 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#128859 - MinxuanZ:mips-sig, r=Amanieu

    Fix the name of signal 19 in library/std/src/sys/pal/unix/process/process_unix/tests.rs for mips/sparc linux
    
    relate to rust-lang#128816
    matthiaskrgr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    2330192 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#128864 - jieyouxu:funnicode, r=Urgau

    Use `SourceMap::end_point` instead of `- BytePos(1)` in arg removal suggestion
    
    Previously, we tried to remove extra arg commas when providing extra arg removal suggestions. One of
    the edge cases is having to account for an arg that has a closing delimiter `)` following it.
    However, the previous suggestion code assumed that the delimiter is in fact exactly the 1-byte `)`
    character. This assumption was proven incorrect, because we recover from Unicode-confusable
    delimiters in the parser, which means that the ending delimiter could be a multi-byte codepoint
    that looks *like* a `)`. Subtracing 1 byte could land us in the middle of a codepoint, triggering a
    codepoint boundary assertion.
    
    This is fixed by using `SourceMap::end_point` which properly accounts for codepoint boundaries.
    
    Fixes rust-lang#128717.
    
    cc ``@fmease`` and rust-lang#128790
    matthiaskrgr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    7b3afdc View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#128865 - jieyouxu:unicurd, r=Urgau

    Ensure let stmt compound assignment removal suggestion respect codepoint boundaries
    
    Previously we would try to issue a suggestion for `let x <op>= 1`, i.e.
    a compound assignment within a `let` binding, to remove the `<op>`. The
    suggestion code unfortunately incorrectly assumed that the `<op>` is an
    exactly-1-byte ASCII character, but this assumption is incorrect because
    we also recover Unicode-confusables like `➖=` as `-=`. In this example,
    the suggestion code used a `+ BytePos(1)` to calculate the span of the
    `<op>` codepoint that looks like `-` but the mult-byte Unicode
    look-alike would cause the suggested removal span to be inside a
    multi-byte codepoint boundary, triggering a codepoint boundary
    assertion.
    
    The fix is to use `SourceMap::start_point(token_span)` which properly accounts for codepoint boundaries.
    
    Fixes rust-lang#128845.
    
    cc rust-lang#128790
    
    r? ``@fmease``
    matthiaskrgr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    2adb15b View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#128874 - Kobzol:cmd-verbose-logging, r=onur…

    …-ozkan
    
    Disable verbose bootstrap command failure logging by default
    
    One of my recent bootstrap command refactoring PRs enabled verbose logging of command failures by default. While this is great for debugging bootstrap, in many situations it's just too verbose and prevents the user from seeing the actual printed stdout/stderr, which usually contains much more useful information.
    
    This PR reverts that logic, and only prints a detailed error when `-v` is passed to bootstrap.
    
    r? ``@onur-ozkan``
    matthiaskrgr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    2b67ea8 View commit details
    Browse the repository at this point in the history