Skip to content

Suggest importable type that differs slightly#156239

Draft
GTimothy wants to merge 3 commits intorust-lang:mainfrom
GTimothy:issue-suggest-similar-imports
Draft

Suggest importable type that differs slightly#156239
GTimothy wants to merge 3 commits intorust-lang:mainfrom
GTimothy:issue-suggest-similar-imports

Conversation

@GTimothy
Copy link
Copy Markdown
Contributor

@GTimothy GTimothy commented May 6, 2026

This PR proposes to add types that differ slightly to suggested imports.
Previous discussion of this topic here: #72641 and in this PR: #72988
If that is still of interest, a discussion may be needed to limit or expand the included list.

I followed the suggestions in #72988.
In this initial change, the list is simply expanded to types with one char edit distance.
The tests are based on the tests by @chrissimpkins in #72988.

I added a is_exact_match field to ImportSuggestion to eventually modify the suggestion text accordingly, but for now it is ignored.

fn test_layout(_x: LayOut){}
//~^ ERROR: cannot find type `LayOut` in this scope
error[E0425]: cannot find type `LayOut` in this scope
  --> $DIR/libstd.rs:3:20
   |
LL | fn test_layout(_x: LayOut){}
   |                    ^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
LL + use std::alloc::Layout;
   |  

for a more complex case:

fn test_systemtime(_x: Systemtime){}
//~^ ERROR: cannot find type `Systemtime` in this scope

struct SystemTome{}
mod st{
    struct SystemTame{}
}
error[E0425]: cannot find type `Systemtime` in this scope
  --> $DIR/libstd.rs:428:24
   |
LL | fn test_systemtime(_x: Systemtime){}
   |                        ^^^^^^^^^^
...
LL | struct SystemTome{}
   | ----------------- similarly named struct `SystemTome` defined here
   |
help: a struct with a similar name exists
   |
LL - fn test_systemtime(_x: Systemtime){}
LL + fn test_systemtime(_x: SystemTome){}
   |
help: consider importing this struct
   |
LL + use std::time::SystemTime;
   |

SystemTame's edit-distance is 2, so not suggested.

GTimothy and others added 3 commits May 6, 2026 14:02
Co-authored-by: Chris Simpkins <git.simpkins@gmail.com>
adds a is_exact_match field to ImportSuggestion that is unused for now.
suggestions now include 1-edit variations as suggestions
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 6, 2026
@GTimothy GTimothy force-pushed the issue-suggest-similar-imports branch from 36cee45 to a23f444 Compare May 6, 2026 12:06
@GTimothy
Copy link
Copy Markdown
Contributor Author

GTimothy commented May 6, 2026

I see from the 247 failed tests that 1-edit difference is too big for small names. 'net' should probably NOT be suggested to replace 'new'...

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
Executing "/scripts/stage_2_test_set1.sh"
+ /scripts/stage_2_test_set1.sh
+ '[' 1 == 1 ']'
+ echo 'PR_CI_JOB set; skipping tidy'
+ SKIP_TIDY='--skip tidy'
+ ../x.py --stage 2 test --skip tidy --skip compiler --skip src
PR_CI_JOB set; skipping tidy
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
---
---- [ui] tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/argument-suggestions/disjoint-spans-issue-151607/disjoint-spans-issue-151607.stderr`
diff of stderr:

12 LL - fn foo(g: F, y: F, e: &E) {
13 LL + fn foo(g: F, y: F, e: &B) {
14    |
- help: you might be missing a type parameter
+ help: consider importing this trait
16    |
- LL | fn foo<E>(g: F, y: F, e: &E) {
-    |       +++
+ LL + use std::cmp::Eq;
+    |
19 
20 error[E0425]: cannot find value `E` in this scope
21   --> $DIR/disjoint-spans-issue-151607.rs:10:18

50 LL -     foo(B, g, D, E, F, G)
51 LL +     foo(B, g, D, E, F, g)
52    |
- help: you might be missing a const parameter
+ help: consider importing one of these constants
54    |
- LL | fn foo<const G: /* Type */>(g: F, y: F, e: &E) {
-    |       +++++++++++++++++++++
+ LL + use std::f128::consts::E;
+    |
+ LL + use std::f16::consts::E;
+    |
---
To only update this specific test, also pass `--test-args argument-suggestions/disjoint-spans-issue-151607.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/argument-suggestions/disjoint-spans-issue-151607" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find type `E` in this scope
##[error]  --> /checkout/tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs:8:24
   |
LL | struct B;
   | --------- similarly named struct `B` defined here
...
LL | fn foo(g: F, y: F, e: &E) {
   |                        ^
   |
help: a struct with a similar name exists
   |
LL - fn foo(g: F, y: F, e: &E) {
LL + fn foo(g: F, y: F, e: &B) {
   |
help: consider importing this trait
   |
LL + use std::cmp::Eq;
   |

error[E0425]: cannot find value `E` in this scope
##[error]  --> /checkout/tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs:10:18
   |
LL |     foo(B, g, D, E, F, G)
   |                  ^
   |
help: a local variable with a similar name exists
   |
LL -     foo(B, g, D, E, F, G)
LL +     foo(B, g, D, e, F, G)
   |
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
   |
---

error[E0425]: cannot find value `G` in this scope
##[error]  --> /checkout/tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs:10:24
   |
LL |     foo(B, g, D, E, F, G)
   |                        ^
   |
help: a local variable with a similar name exists
   |
LL -     foo(B, g, D, E, F, G)
LL +     foo(B, g, D, E, F, g)
   |
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
   |
---

error[E0061]: this function takes 3 arguments but 6 arguments were supplied
##[error]  --> /checkout/tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs:10:5
   |
LL |     foo(B, g, D, E, F, G)
   |     ^^^ -     -  - unexpected argument #4
   |         |     |
   |         |     unexpected argument #3 of type `D`
   |         unexpected argument #1 of type `B`
   |
note: function defined here
  --> /checkout/tests/ui/argument-suggestions/disjoint-spans-issue-151607.rs:8:4
   |
LL | fn foo(g: F, y: F, e: &E) {
   |    ^^^             -----
help: consider borrowing here
   |
LL |     foo(B, g, D, E, F, &G)
   |                        +
help: remove the extra arguments
   |
LL -     foo(B, g, D, E, F, G)
LL +     foo(, g, F, G)
   |

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0061, E0425.
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/argument-suggestions/extern-fn-arg-names/extern-fn-arg-names.stderr`
diff of stderr:

3    |
4 LL |     fn dstfn(src: i32, dst: err);
5    |                             ^^^ not found in this scope
+    |
+ help: there is an enum variant `std::result::Result::Err`; try using the variant's enum
+    |
+ LL -     fn dstfn(src: i32, dst: err);
+ LL +     fn dstfn(src: i32, dst: std::result::Result);
+    |
6 
7 error[E0061]: this function takes 2 arguments but 1 argument was supplied
8   --> $DIR/extern-fn-arg-names.rs:7:5


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args argument-suggestions/extern-fn-arg-names.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/argument-suggestions/extern-fn-arg-names.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/argument-suggestions/extern-fn-arg-names" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find type `err` in this scope
##[error]  --> /checkout/tests/ui/argument-suggestions/extern-fn-arg-names.rs:2:29
   |
LL |     fn dstfn(src: i32, dst: err);
   |                             ^^^ not found in this scope
   |
help: there is an enum variant `std::result::Result::Err`; try using the variant's enum
   |
LL -     fn dstfn(src: i32, dst: err);
LL +     fn dstfn(src: i32, dst: std::result::Result);
   |

error[E0061]: this function takes 2 arguments but 1 argument was supplied
##[error]  --> /checkout/tests/ui/argument-suggestions/extern-fn-arg-names.rs:7:5
   |
LL |     dstfn(1);
   |     ^^^^^--- argument #2 is missing
   |
note: function defined here
  --> /checkout/tests/ui/argument-suggestions/extern-fn-arg-names.rs:2:8
   |
LL |     fn dstfn(src: i32, dst: err);
   |        ^^^^^           ---
help: provide the argument
   |
LL |     dstfn(1, /* dst */);
   |            +++++++++++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0061, E0425.
---
---- [ui] tests/ui/argument-suggestions/issue-109831.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/argument-suggestions/issue-109831/issue-109831.stderr`
diff of stderr:

31 LL -     f(A, A, B, C);
32 LL +     f(A, A, B, A);
33    |
+ help: consider importing one of these constants
+    |
+ LL + use std::f128::consts::E;
+    |
---
To only update this specific test, also pass `--test-args argument-suggestions/issue-109831.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/argument-suggestions/issue-109831.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/argument-suggestions/issue-109831" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find type `C` in this scope
##[error]  --> /checkout/tests/ui/argument-suggestions/issue-109831.rs:4:24
   |
LL | struct A;
   | --------- similarly named struct `A` defined here
...
LL | fn f(b1: B, b2: B, a2: C) {} //~ ERROR E0425
   |                        ^
   |
help: a struct with a similar name exists
   |
LL - fn f(b1: B, b2: B, a2: C) {} //~ ERROR E0425
LL + fn f(b1: B, b2: B, a2: A) {} //~ ERROR E0425
   |
help: you might be missing a type parameter
   |
LL | fn f<C>(b1: B, b2: B, a2: C) {} //~ ERROR E0425
   |     +++

error[E0425]: cannot find value `C` in this scope
##[error]  --> /checkout/tests/ui/argument-suggestions/issue-109831.rs:7:16
   |
LL | struct A;
   | --------- similarly named unit struct `A` defined here
...
LL |     f(A, A, B, C); //~ ERROR E0425
   |                ^
   |
help: a unit struct with a similar name exists
   |
LL -     f(A, A, B, C); //~ ERROR E0425
LL +     f(A, A, B, A); //~ ERROR E0425
   |
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
   |
---

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
##[error]  --> /checkout/tests/ui/argument-suggestions/issue-109831.rs:7:5
   |
LL |     f(A, A, B, C); //~ ERROR E0425
   |     ^ -  -     - unexpected argument #4
   |       |  |
   |       |  expected `B`, found `A`
   |       expected `B`, found `A`
   |
note: function defined here
  --> /checkout/tests/ui/argument-suggestions/issue-109831.rs:4:4
   |
LL | fn f(b1: B, b2: B, a2: C) {} //~ ERROR E0425
   |    ^ -----  -----
help: remove the extra argument
   |
LL -     f(A, A, B, C); //~ ERROR E0425
LL +     f(/* B */, /* B */, B); //~ ERROR E0425
   |

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0061, E0425.
---
---- [ui] tests/ui/asm/const-resolve-error.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/const-resolve-error/const-resolve-error.stderr`
diff of stderr:

4 LL |     asm!("/* {0} */", const N);
5    |                             ^ not found in this scope
6    |
- help: you might be missing a const parameter
+ help: consider importing one of these constants
8    |
- LL | async unsafe fn foo<'a, const N: /* Type */>() {
-    |                       +++++++++++++++++++++
+ LL + use std::f128::consts::E;
+    |
+ LL + use std::f16::consts::E;
+    |
---
To only update this specific test, also pass `--test-args asm/const-resolve-error.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/asm/const-resolve-error.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/const-resolve-error" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find value `N` in this scope
##[error]  --> /checkout/tests/ui/asm/const-resolve-error.rs:7:29
   |
LL |     asm!("/* {0} */", const N); //~ ERROR E0425
   |                             ^ not found in this scope
   |
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/global-asm-with-error/global-asm-with-error.stderr`
diff of stderr:

3    |
4 LL | global_asm!("/* {} */", sym a);
5    |                             ^ not found in this scope
+    |
+ help: consider importing one of these constants
+    |
+ LL + use std::f128::consts::E;
---
To only update this specific test, also pass `--test-args asm/global-asm-with-error.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/asm/global-asm-with-error.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/global-asm-with-error" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find value `a` in this scope
##[error]  --> /checkout/tests/ui/asm/global-asm-with-error.rs:8:29
   |
LL | global_asm!("/* {} */", sym a);
   |                             ^ not found in this scope
   |
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
---
To only update this specific test, also pass `--test-args async-await/impl-future-escaping-bound-vars-ice.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/impl-future-escaping-bound-vars-ice.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/async-await/impl-future-escaping-bound-vars-ice" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find value `u` in this scope
##[error]  --> /checkout/tests/ui/async-await/impl-future-escaping-bound-vars-ice.rs:11:24
   |
LL |     let _ = test_ref & u; //~ ERROR cannot find value `u` in this scope
   |                        ^ not found in this scope
   |
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
---

error[E0277]: `u32` is not a future
##[error]  --> /checkout/tests/ui/async-await/impl-future-escaping-bound-vars-ice.rs:5:25
   |
LL | fn test_ref(x: &u32) -> impl std::future::Future<Output = u32> + '_ {
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `u32` is not a future
LL |     //~^ ERROR `u32` is not a future
LL |     *x
   |     -- return type was inferred to be `u32` here
   |
   = help: the trait `Future` is not implemented for `u32`
---
------------------------------------------

---- [ui] tests/ui/async-await/impl-future-escaping-bound-vars-ice.rs stdout end ----
---- [ui] tests/ui/attributes/align-on-fields-143987.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/attributes/align-on-fields-143987/align-on-fields-143987.stderr`
diff of stderr:

9 LL -     x: usize8,
10 LL +     x: usize,
11    |
---
To only update this specific test, also pass `--test-args attributes/align-on-fields-143987.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/attributes/align-on-fields-143987.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/attributes/align-on-fields-143987" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find type `usize8` in this scope
##[error]  --> /checkout/tests/ui/attributes/align-on-fields-143987.rs:17:8
   |
LL |     x: usize8, //~ ERROR cannot find type `usize8` in this scope
   |        ^^^^^^
   |
help: a builtin type with a similar name exists
   |
LL -     x: usize8, //~ ERROR cannot find type `usize8` in this scope
LL +     x: usize, //~ ERROR cannot find type `usize8` in this scope
   |
help: consider importing one of these items
   |
LL + use std::primitive::usize;
   |
LL + use std::simd::usizex8;
   |

error: `#[rustc_align]` attribute cannot be used on struct fields
##[error]  --> /checkout/tests/ui/attributes/align-on-fields-143987.rs:10:5
   |
LL |     #[rustc_align(8)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields
   |     ^^^^^^^^^^^^^^^^^
   |
   = help: `#[rustc_align]` can only be applied to functions

error: `#[rustc_align]` attribute cannot be used on struct fields
##[error]  --> /checkout/tests/ui/attributes/align-on-fields-143987.rs:16:5
   |
LL |     #[rustc_align(8)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields
   |     ^^^^^^^^^^^^^^^^^
   |
   = help: `#[rustc_align]` can only be applied to functions

error: `#[rustc_align]` attribute cannot be used on struct fields
##[error]  --> /checkout/tests/ui/attributes/align-on-fields-143987.rs:22:5
   |
LL |     #[rustc_align(32)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields
   |     ^^^^^^^^^^^^^^^^^^
   |
   = help: `#[rustc_align]` can only be applied to functions

error: aborting due to 4 previous errors
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463/non-ADT-struct-pattern-box-pattern-ice-121463.stderr`
diff of stderr:

8    |
9 LL |     let mut a = Eq::StructVar { boxed: Box::new(5_i32) };
10    |                  +
+ help: consider importing this trait
+    |
+ LL + use std::cmp::Eq;
+    |
11 
12 error[E0433]: cannot find type `E` in this scope
13   --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9

19    |
20 LL |         Eq::StructVar { box boxed } => { }
21    |          +
+ help: consider importing this trait
+    |
+ LL + use std::cmp::Eq;
+    |
---
To only update this specific test, also pass `--test-args borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0433]: cannot find type `E` in this scope
##[error]  --> /checkout/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17
   |
LL |     let mut a = E::StructVar { boxed: Box::new(5_i32) };
   |                 ^ use of undeclared type `E`
   |
help: a trait with a similar name exists
   |
LL |     let mut a = Eq::StructVar { boxed: Box::new(5_i32) };
   |                  +
help: consider importing this trait
   |
LL + use std::cmp::Eq;
   |

error[E0433]: cannot find type `E` in this scope
##[error]  --> /checkout/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9
   |
LL |         E::StructVar { box boxed } => { }
   |         ^ use of undeclared type `E`
   |
help: a trait with a similar name exists
   |
LL |         Eq::StructVar { box boxed } => { }
   |          +
help: consider importing this trait
   |
LL + use std::cmp::Eq;
   |
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/c-variadic/issue-86053-1/issue-86053-1.stderr`
diff of stderr:

67    |
68 LL |     self , _: ... ,   self ,   self , _: ... ) where Fn : FnOnce ( & 'a & 'b usize ) {
69    |                                                       +
- help: you might be missing a type parameter
+ help: consider importing this trait
71    |
- LL | fn ordering4 < 'a , 'b, F     > ( a :            ,   self , self ,   self ,
-    |                       +++
+ LL + use std::ops::Fn;
+    |
74 
75 error: aborting due to 10 previous errors
---
To only update this specific test, also pass `--test-args c-variadic/issue-86053-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/c-variadic/issue-86053-1.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/c-variadic/issue-86053-1" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: expected type, found `,`
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:6:47
   |
LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
   |                                               ^ expected type

error: unexpected `self` parameter in function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:6:51
   |
LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
   |                                                   ^^^^ must be the first parameter of an associated function

error: unexpected `self` parameter in function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:6:58
   |
LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
   |                                                          ^^^^ must be the first parameter of an associated function

error: unexpected `self` parameter in function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:6:67
   |
LL | fn ordering4 < 'a , 'b     > ( a :            ,   self , self ,   self ,
   |                                                                   ^^^^ must be the first parameter of an associated function

error: unexpected `self` parameter in function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:11:5
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) {
   |     ^^^^ must be the first parameter of an associated function

error: unexpected `self` parameter in function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:11:23
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) {
   |                       ^^^^ must be the first parameter of an associated function

error: unexpected `self` parameter in function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:11:32
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) {
   |                                ^^^^ must be the first parameter of an associated function

error: `...` must be the last argument of a C-variadic function
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:11:12
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) {
   |            ^^^^^^

error: `...` is not supported for non-extern functions
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:11:39
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) {
   |                                       ^^^^^^
   |
   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list

error[E0425]: cannot find type `F` in this scope
##[error]  --> /checkout/tests/ui/c-variadic/issue-86053-1.rs:11:54
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) {
   |                                                      ^
   |
  --> /rustc/FAKE_PREFIX/library/core/src/ops/function.rs:76:0
   |
   = note: similarly named trait `Fn` defined here
help: a trait with a similar name exists
   |
LL |     self , _: ... ,   self ,   self , _: ... ) where Fn : FnOnce ( & 'a & 'b usize ) {
   |                                                       +
help: consider importing this trait
   |
LL + use std::ops::Fn;
   |
---
To only update this specific test, also pass `--test-args cast/cast-errors-issue-43825.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/cast/cast-errors-issue-43825.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/cast/cast-errors-issue-43825" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find value `error` in this scope
##[error]  --> /checkout/tests/ui/cast/cast-errors-issue-43825.rs:2:17
   |
LL |     let error = error; //~ ERROR cannot find value `error`
   |                 ^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
LL + use std::fmt::Error;
---
To only update this specific test, also pass `--test-args cfg/nested-cfg-attr-conditional-compilation.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/cfg/nested-cfg-attr-conditional-compilation.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/cfg/nested-cfg-attr-conditional-compilation" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find function `f` in this scope
##[error]  --> /checkout/tests/ui/cfg/nested-cfg-attr-conditional-compilation.rs:17:5
   |
LL |     f() //~ ERROR cannot find function `f` in this scope
   |     ^ not found in this scope
   |
note: found an item that was configured out
  --> /checkout/tests/ui/cfg/nested-cfg-attr-conditional-compilation.rs:14:4
   |
LL | #[cfg_attr(true, cfg_attr(true, cfg(false)))] //~ NOTE the item is gated here
   |                                     ----- the item is gated here
LL | fn f() {} //~ NOTE found an item that was configured out
   |    ^
help: consider importing one of these constants
   |
LL + use std::f128::consts::E;
   |
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/closures/issue-78720/issue-78720.stderr`
diff of stderr:

17    |
18 LL |     _func: Fn,
19    |             +
- help: you might be missing a type parameter
+ help: consider importing this trait
21    |
- LL | struct Map2<Segment2, F> {
-    |                     +++
+ LL + use std::ops::Fn;
+    |
24 
25 error[E0282]: type annotations needed
---
To only update this specific test, also pass `--test-args closures/issue-78720.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/closures/issue-78720.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/closures/issue-78720" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: at least one trait must be specified
##[error]  --> /checkout/tests/ui/closures/issue-78720.rs:1:16
   |
---
   |
   = note: similarly named trait `Fn` defined here
help: a trait with a similar name exists
   |
LL |     _func: Fn,
   |             +
help: consider importing this trait
   |
LL + use std::ops::Fn;
   |
---

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/closures/issue-78720.rs:8:39
   |
LL |     fn map2<F>(self, f: F) -> Map2<F> {}
   |                                       ^^ expected `Map2<F>`, found `()`
   |
   = note: expected struct `Map2<F>`
           found unit type `()`

error[E0277]: the size for values of type `Self` cannot be known at compilation time
##[error]  --> /checkout/tests/ui/closures/issue-78720.rs:8:16
   |
LL |     fn map2<F>(self, f: F) -> Map2<F> {}
   |                ^^^^ doesn't have a size known at compile-time
   |
   = help: unsized fn params are gated as an unstable feature
help: consider further restricting `Self`
   |
LL |     fn map2<F>(self, f: F) -> Map2<F> where Self: Sized {}
   |                                       +++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
   |
LL |     fn map2<F>(&self, f: F) -> Map2<F> {}
   |                +

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0277, E0282, E0308, E0425.
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/closures/issue-90871/issue-90871.stderr`
diff of stderr:

11    |
12 LL |     type_ascribe!(2, Fn([u8; || 1]))
13    |                      +
+ help: consider importing this trait
+    |
+ LL + use std::ops::Fn;
+    |
---
To only update this specific test, also pass `--test-args closures/issue-90871.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/closures/issue-90871.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/closures/issue-90871" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find type `n` in this scope
##[error]  --> /checkout/tests/ui/closures/issue-90871.rs:4:22
   |
LL |     type_ascribe!(2, n([u8; || 1]))
   |                      ^
   |
  --> /rustc/FAKE_PREFIX/library/core/src/ops/function.rs:76:0
   |
   = note: similarly named trait `Fn` defined here
help: a trait with a similar name exists
   |
LL |     type_ascribe!(2, Fn([u8; || 1]))
   |                      +
help: consider importing this trait
   |
LL + use std::ops::Fn;
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/closures/issue-90871.rs:4:29
   |
LL |     type_ascribe!(2, n([u8; || 1]))
   |                             ^^^^ expected `usize`, found closure
   |
   = note: expected type `usize`
           found closure `{closure@/checkout/tests/ui/closures/issue-90871.rs:4:29: 4:31}`
   = note: array length can only be `usize`
help: use parentheses to call this closure
   |
LL |     type_ascribe!(2, n([u8; (|| 1)()]))
   |                             +    +++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0308, E0425.
---
6    |
- help: you might be missing a type parameter
+ help: consider importing this struct
8    |
- LL | enum B<D> {
-    |       +++
+ LL + use std::arch::aarch64::LD;
+    |
11 
12 error[E0005]: refutable pattern in local binding
---
To only update this specific test, also pass `--test-args closures/malformed-pattern-issue-140011.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/closures/malformed-pattern-issue-140011.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/closures/malformed-pattern-issue-140011" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Wrust-2021-incompatible-closure-captures"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find type `D` in this scope
##[error]  --> /checkout/tests/ui/closures/malformed-pattern-issue-140011.rs:3:7
   |
LL |     C(D), //~ ERROR: cannot find type `D` in this scope
   |       ^ not found in this scope
   |
help: consider importing this struct
   |
LL + use std::arch::aarch64::LD;
   |

error[E0005]: refutable pattern in local binding
##[error]  --> /checkout/tests/ui/closures/malformed-pattern-issue-140011.rs:9:13
   |
LL |         let B::E(a) = h; //~ ERROR: refutable pattern in local binding
   |             ^^^^^^^ pattern `B::C(_)` not covered
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
note: `B` defined here
  --> /checkout/tests/ui/closures/malformed-pattern-issue-140011.rs:2:6
   |
LL | enum B {
   |      ^
LL |     C(D), //~ ERROR: cannot find type `D` in this scope
   |     - not covered
   = note: the matched value is of type `B`
help: you might want to use `let...else` to handle the variant that isn't matched
   |
LL |         let B::E(a) = h else { todo!() }; //~ ERROR: refutable pattern in local binding
   |                         ++++++++++++++++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0005, E0425.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants