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

Closed

Commits on Jan 22, 2023

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

Commits on Jan 27, 2023

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

Commits on Jan 29, 2023

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

Commits on Jan 31, 2023

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

Commits on Feb 1, 2023

  1. Fix syntax in -Zunpretty-expanded output for derived PartialEq.

    If you do `derive(PartialEq)` on a packed struct, the output shown by
    `-Zunpretty=expanded` includes expressions like this:
    ```
    { self.x } == { other.x }
    ```
    This is invalid syntax. This doesn't break compilation, because the AST
    nodes are constructed within the compiler. But it does mean anyone using
    `-Zunpretty=expanded` output as a guide for hand-written impls could get
    a nasty surprise.
    
    This commit fixes things by instead using this form:
    ```
    ({ self.x }) == ({ other.x })
    ```
    nnethercote committed Feb 1, 2023
    Configuration menu
    Copy the full SHA
    75e87d1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b96c899 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f8bf60 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    63f82db View commit details
    Browse the repository at this point in the history
  5. Add proc-macro boilerplate to crt-static test

    Joseph Ryan committed Feb 1, 2023
    Configuration menu
    Copy the full SHA
    fb38578 View commit details
    Browse the repository at this point in the history
  6. Revert "Teach parser to understand fake anonymous enum syntax" and re…

    …lated commits
    
    Revert "review comment: Remove AST AnonTy"
    
    This reverts commit 020cca8.
    
    Revert "Ensure macros are not affected"
    
    This reverts commit 12d18e4.
    
    Revert "Emit fewer errors on patterns with possible type ascription"
    
    This reverts commit c847a01.
    
    Revert "Teach parser to understand fake anonymous enum syntax"
    
    This reverts commit 2d82420.
    compiler-errors committed Feb 1, 2023
    Configuration menu
    Copy the full SHA
    619de1b View commit details
    Browse the repository at this point in the history
  7. Add a test

    compiler-errors committed Feb 1, 2023
    Configuration menu
    Copy the full SHA
    250f530 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2023

  1. Rollup merge of rust-lang#106919 - compiler-errors:underscore-typo-in…

    …-field-pat, r=jackh726
    
    Recover `_` as `..` in field pattern
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    c8f7387 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#106925 - imWildCat:imWildCat/remove-hardcod…

    …ed-ios-macbi-target-version, r=wesleywiser
    
    Remove hardcoded iOS version of clang target for Mac Catalyst
    
    ## Background
    
    From `clang` 13.x, `-target x86_64-apple-ios13.0-macabi` fails while linking:
    
    ```
      = note: clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
    ```
    
    <details>
    <summary>Verbose output</summary>
    
    ```
    error: linking with `cc` failed: exit status: 1
      |
      = note: LC_ALL="C" PATH="[removed]" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-Wl,-exported_symbols_list,/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/list" "-target" "x86_64-apple-ios13.0-macabi" "/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/symbols.o" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/[user].[user].a2ccc648-cgu.0.rcgu.o" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps" "-L" "/path/to/my/[project]/[user]/target/release/deps" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/build/blake3-74e6ba91506ce712/out" "-L" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/build/blake3-74e6ba91506ce712/out" "-L" "/Users/[user]/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/x86_64-apple-ios-macabi/lib" "/var/folders/p8/qpmzbsdn07g5gxykwfxxw7y40000gn/T/rustci8tkvp/libblake3-343c1616c8f62c66.rlib" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/libcompiler_builtins-15d4f20b641cf9ef.rlib" "-framework" "Security" "-framework" "CoreFoundation" "-framework" "Security" "-liconv" "-lSystem" "-lobjc" "-framework" "Security" "-framework" "Foundation" "-lc" "-lm" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk" "-Wl,-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk" "-L" "/Users/[user]/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/x86_64-apple-ios-macabi/lib" "-o" "/path/to/my/[project]/[user]/target/x86_64-apple-ios-macabi/release/deps/lib[user].dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
      = note: clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
    
    warning: `[user]` (lib) generated 6 warnings
    error: could not compile `[user]` due to previous error; 6 warnings emitted
    ```
    </details>
    
    ### Minimal example
    
    C code:
    
    ```c
    #include <stdio.h>
    void main() {
        int a = 1;
        int b = 2;
        int c = a + b;
        printf("%d", c);
    }
    ```
    
    `clang` command sample:
    
    ```
    ➜  202301 clang -target x86_64-apple-ios13.0-macabi main.c
    clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
    ➜  202301 clang -target x86_64-apple-ios14.0-macabi main.c
    main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
    void main() {
    ^
    main.c:2:1: note: change return type to 'int'
    void main() {
    ^~~~
    int
    1 warning generated.
    ➜  202301 clang -target x86_64-apple-ios15.0-macabi main.c
    main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
    void main() {
    ^
    main.c:2:1: note: change return type to 'int'
    void main() {
    ^~~~
    int
    1 warning generated.
    ➜  202301 clang -target x86_64-apple-ios-macabi main.c
    main.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
    void main() {
    ^
    main.c:2:1: note: change return type to 'int'
    void main() {
    ^~~~
    int
    1 warning generated.
    
    ➜  202301 clang --version
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    Target: arm64-apple-darwin22.2.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    ```
    
    This PR is a simplified version of rust-lang#96392, inspired by rust-lang/cc-rs#727
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    a6b171d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#107201 - compiler-errors:confusing-async-fn…

    …-note, r=estebank
    
    Remove confusing 'while checking' note from opaque future type mismatches
    
    Maybe I'm just misinterpreting the wording of the note. The only value I can see in this note is that it points out where the async's opaque future is coming from, but the way it's doing it is misleading IMO.
    
    For example:
    
    ```rust
    note: while checking the return type of the `async fn`
      --> $DIR/dont-suggest-missing-await.rs:7:24
       |
    LL | async fn make_u32() -> u32 {
       |                        ^^^ checked the `Output` of this `async fn`, found opaque type
    ```
    
    We point at the type `u32` in the HIR, but then say "found opaque type". We also say "while checking"... but we're typechecking a totally different function when we get this type mismatch!
    
    r? `@estebank` but feel free to reassign and/or take your time reviewing this. I'd be inclined to also discuss reworking the presentation of this type mismatch to restore some of these labels in a way that makes it more clear what it's trying to point out.
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    9d959ea View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#107478 - compiler-errors:anon-enum-tys-are-…

    …ambiguous, r=estebank
    
    Revert "Teach parser to understand fake anonymous enum syntax" and related commits
    
    anonymous enum types are currently ambiguous in positions like:
    
    * `|` operator: `a as fn() -> B | C`
    * closure args: `|_: as fn() -> A | B`
    
    I first tried to thread around `RecoverAnonEnum` into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board.
    
    Fixes rust-lang#107461
    
    cc: `@estebank` `@cjgillot` rust-lang#106960
    
    ---
    ### Squashed revert commits:
    
    Revert "review comment: Remove AST AnonTy"
    
    This reverts commit 020cca8.
    
    Revert "Ensure macros are not affected"
    
    This reverts commit 12d18e4.
    
    Revert "Emit fewer errors on patterns with possible type ascription"
    
    This reverts commit c847a01.
    
    Revert "Teach parser to understand fake anonymous enum syntax"
    
    This reverts commit 2d82420.
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    93e9dac View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#107488 - nnethercote:fix-PartialEq-syntax, …

    …r=RalfJung
    
    Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.
    
    If you do `derive(PartialEq)` on a packed struct, the output shown by `-Zunpretty=expanded` includes expressions like this:
    ```
    { self.x } == { other.x }
    ```
    This is invalid syntax. This doesn't break compilation, because the AST nodes are constructed within the compiler. But it does mean anyone using `-Zunpretty=expanded` output as a guide for hand-written impls could get a nasty surprise.
    
    This commit fixes things by instead using this form:
    ```
    ({ self.x }) == ({ other.x })
    ```
    
    r? `@RalfJung`
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    191ee56 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#107493 - clubby789:range-fat-arrow-followup…

    …, r=estebank
    
    Improve diagnostic for missing space in range pattern
    
    Improves the diagnostic in rust-lang#107425 by turning it into a note explaining the parsing issue.
    
    r? `@compiler-errors`
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    beb3f5d View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#107531 - GuillaumeGomez:inline-images-in-cs…

    …s, r=notriddle
    
    Inline CSS background images directly into the CSS
    
    A nice advantage of this is that it removes a few entries in the list of static files.
    
    r? `@notriddle`
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    8c835be View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#107559 - WaffleLapkin:is_it_2015¿, r=davidtwco

    Rename `rust_2015` → `is_rust_2015`
    
    r? `@compiler-errors`
    rust-lang#107508 (comment)
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    abd02cc View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#107576 - P1n3appl3:master, r=tmandry

    Add proc-macro boilerplate to crt-static test
    
    I was seeing this failure when running ui tests with with a `-Cpanic=abort` stdlib targeting fuchsia:
    
    ```
    ---- [ui] tests/ui/proc-macro/crt-static.rs stdout ----
    normalized stderr:
    warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
    
    warning: 1 warning emitted
    
    The actual stderr differed from the expected stderr.
    ```
    
    `force-host` was enough to stop it from running/failing, not sure if I should also add `needs-unwind`?
    compiler-errors committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    e3c0499 View commit details
    Browse the repository at this point in the history