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

Merged
merged 20 commits into from
Jul 25, 2024
Merged

Rollup of 5 pull requests #128169

merged 20 commits into from
Jul 25, 2024

Commits on Jul 10, 2024

  1. Configuration menu
    Copy the full SHA
    e844581 View commit details
    Browse the repository at this point in the history
  2. Improve error message

    compiler-errors committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    32c8bfd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    898ed2f View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

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

Commits on Jul 12, 2024

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

Commits on Jul 18, 2024

  1. Replace ASCII control chars with Unicode Control Pictures

    ```
    error: bare CR not allowed in doc-comment
      --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:3:32
       |
    LL | /// doc comment with bare CR: '␍'
       |                                ^
    ```
    estebank committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    89f273f View commit details
    Browse the repository at this point in the history
  2. Be more accurate about calculating display_col from a BytePos

    No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter.
    
    This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2):
    
    ```
    error: this file contains an unclosed delimiter
      --> $DIR/issue-68629.rs:5:17
       |
    LL | ␜␟ts␀![{i
       |       -- unclosed delimiter
       |       |
       |       unclosed delimiter
    LL | ␀␀  fn rݻoa>rݻm
       |                ^
    ```
    estebank committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    2d7795d View commit details
    Browse the repository at this point in the history
  3. Make unicode text flow control chars visible as �

    We already point these out quite aggressively, telling people not to use them, but would normally be rendered as nothing. Having them visible will make it easier for people to actually deal with them.
    
    ```
    error: unicode codepoint changing visible direction of text present in literal
      --> $DIR/unicode-control-codepoints.rs:26:22
       |
    LL |     println!("{:?}", '�');
       |                      ^-^
       |                      ||
       |                      |'\u{202e}'
       |                      this literal contains an invisible unicode text flow control codepoint
       |
       = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
       = help: if their presence wasn't intentional, you can remove them
    help: if you want to keep them but make them visible in your source code, you can escape them
       |
    LL |     println!("{:?}", '\u{202e}');
       |                       ~~~~~~~~
    ```
    
    vs the previous
    
    ```
    error: unicode codepoint changing visible direction of text present in literal
      --> $DIR/unicode-control-codepoints.rs:26:22
       |
    LL |     println!("{:?}", '');
       |                      ^-
       |                      ||
       |                      |'\u{202e}'
       |                      this literal contains an invisible unicode text flow control codepoint
       |
       = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
       = help: if their presence wasn't intentional, you can remove them
    help: if you want to keep them but make them visible in your source code, you can escape them
       |
    LL |     println!("{:?}", '\u{202e}');
       |                       ~~~~~~~~
    ```
    estebank committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    9dffe95 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

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

Commits on Jul 23, 2024

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

Commits on Jul 24, 2024

  1. Do not use question as label

    We don't want to have questions in the diagnostic output. Instead, we use wording that communicates uncertainty, like "might":
    
    ```
    error[E0432]: unresolved import `spam`
      --> $DIR/import-from-missing-star-3.rs:2:9
       |
    LL |     use spam::*;
       |         ^^^^ you might be missing crate `spam`
       |
       = help: consider adding `extern crate spam` to use the `spam` crate
    ```
    estebank committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    850faea View commit details
    Browse the repository at this point in the history
  2. Fix ddltool-failed test

    estebank committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    9bd7680 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0919d07 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Configuration menu
    Copy the full SHA
    7da751a View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#127054 - compiler-errors:bound-ordering, r=…

    …fmease
    
    Reorder trait bound modifiers *after* `for<...>` binder in trait bounds
    
    This PR suggests changing the grammar of trait bounds from:
    
    ```
    [CONSTNESS] [ASYNCNESS] [?] [BINDER] [TRAIT_PATH]
    
    const async ? for<'a> Sized
    ```
    
    to
    
    ```
    ([BINDER] [CONSTNESS] [ASYNCNESS] | [?]) [TRAIT_PATH]
    ```
    
    i.e., either
    
    ```
    ? Sized
    ```
    
    or
    
    ```
    for<'a> const async Sized
    ```
    
    (but not both)
    
    ### Why?
    
    I think it's strange that the binder applies "more tightly" than the `?` trait polarity. This becomes even weirder when considering that we (or at least, I) want to have `async` trait bounds expressed like:
    
    ```
    where T: for<'a> async Fn(&'a ()) -> i32,
    ```
    
    and not:
    
    ```
    where T: async for<'a> Fn(&'a ()) -> i32,
    ```
    
    ### Fallout
    
    No crates on crater use this syntax, presumably because it's literally useless. This will require modifying the reference grammar, though.
    
    ### Alternatives
    
    If this is not desirable, then we can alternatively keep parsing `for<'a>` after the `?` but deprecate it with either an FCW (or an immediate hard error), and begin parsing `for<'a>` *before* the `?`.
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    cfc5f25 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#127528 - estebank:ascii-control-chars, r=ol…

    …i-obk
    
    Replace ASCII control chars with Unicode Control Pictures
    
    Replace ASCII control chars like `CR` with Unicode Control Pictures like `␍`:
    
    ```
    error: bare CR not allowed in doc-comment
      --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:3:32
       |
    LL | /// doc comment with bare CR: '␍'
       |                                ^
    ```
    
    Centralize the checking of unicode char width for the purposes of CLI display in one place. Account for the new replacements. Remove unneeded tracking of "zero-width" unicode chars, as we calculate these in the `SourceMap` as needed now.
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    cce2db0 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#127872 - Oneirical:antestral-traditions, r=…

    …jieyouxu
    
    Migrate `pointer-auth-link-with-c`, `c-dynamic-rlib` and `c-dynamic-dylib` `run-make` tests to rmake
    
    Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
    
    Please try:
    
    try-job: x86_64-msvc
    try-job: i686-mingw
    try-job: aarch64-apple
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    04e4569 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#128111 - estebank:no-question, r=fmease

    Do not use question as label
    
    We don't want to have questions in the diagnostic output. Instead, we use wording that communicates uncertainty, like "might":
    
    ```
    error[E0432]: unresolved import `spam`
      --> $DIR/import-from-missing-star-3.rs:2:9
       |
    LL |     use spam::*;
       |         ^^^^ you might be missing crate `spam`
       |
       = help: consider adding `extern crate spam` to use the `spam` crate
    ```
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    40557c8 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#128160 - compiler-errors:auto, r=jackh726

    Don't ICE when auto trait has assoc ty in old solver
    
    Kinda a pointless change to make, but it's observable w/o the feature gate, so let's just fix it. I reintroduced this ICE when I removed the "auto impl" kind from `ImplSource` in rust-lang#112687.
    
    Fixes rust-lang#117829
    Fixes rust-lang#127746
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    1fda084 View commit details
    Browse the repository at this point in the history