Skip to content

Conversation

Oneirical
Copy link
Contributor

Part of #133895

Methodology:

  1. Refer to the previously written tests/ui/SUMMARY.md
  2. Find an appropriate category for the test, using the original issue thread and the test contents.
  3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
  4. Rename the tests to make their purpose clearer

Inspired by the methodology that @Kivooeo was using.

r? @jieyouxu

@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 Aug 26, 2025
@Oneirical Oneirical marked this pull request as ready for review August 26, 2025 21:03
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2025

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, some nits. I can't seem to figure out what happened to the two removed tests tho.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 5, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Sep 5, 2025

Also tiny nit: can you refrain from at-mentioning Kivo in PR description

Inspired by the methodology that @Kivooeo was using.

(just remove the @)

Inspired by the methodology that Kivooeo was using.

is fine. Otherwise, they will get pinged for each of such PRs.

@Oneirical Oneirical force-pushed the uncountable-integer-11 branch from f390533 to 37c9001 Compare September 12, 2025 20:15
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
1 error[E0382]: use of moved value: `orig`
-   --> $DIR/moved-value-in-closure-64559.rs:5:20
+   --> $DIR/moved-value-in-closure-suggestion-64559.rs:5:20
3    |
4 LL |     let orig = vec![true];
5    |         ---- move occurs because `orig` has type `Vec<bool>`, which does not implement the `Copy` trait

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/borrowck/moved-value-in-closure-suggestion-64559.rs:5:20
+   --> $DIR/moved-value-in-closure-suggestion-64559.rs:5:20


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 borrowck/moved-value-in-closure-suggestion-64559.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/moved-value-in-closure-suggestion-64559.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/moved-value-in-closure-suggestion-64559" "-A" "unused" "-A" "internal_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[E0382]: use of moved value: `orig`
##[error]  --> /checkout/tests/ui/borrowck/moved-value-in-closure-suggestion-64559.rs:5:20
   |
LL |     let orig = vec![true];
   |         ---- move occurs because `orig` has type `Vec<bool>`, which does not implement the `Copy` trait
LL |     for _val in orig {}
   |                 ---- `orig` moved due to this implicit call to `.into_iter()`
LL |     let _closure = || orig;
   |                    ^^ ---- use occurs due to use in closure
   |                    |
   |                    value used here after move
   |
note: `into_iter` takes ownership of the receiver `self`, which moves `orig`
  --> /rustc/FAKE_PREFIX/library/core/src/iter/traits/collect.rs:310:18
help: consider iterating over a slice of the `Vec<bool>`'s content to avoid moving into the `for` loop
   |
LL |     for _val in &orig {}
   |                 +

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0382`.
---
49 error[E0308]: mismatched types
-   --> $DIR/generic-struct-self-unconstrained-inference-vars-6930:28:14
+   --> $DIR/generic-struct-self-unconstrained-inference-vars-69306.rs:28:14
51    |
52 LL | impl<T> Foo<T> for <S0<T> as Fun>::Out {
53    |      - expected this type parameter

60    = note: expected type parameter `T`
61                         found type `{integer}`
62 note: tuple struct defined here
-   --> $DIR/generic-struct-self-unconstrained-inference-vars-6930:4:8
---
80 note: tuple struct defined here
-   --> $DIR/generic-struct-self-unconstrained-inference-vars-6930:32:8
+   --> $DIR/generic-struct-self-unconstrained-inference-vars-69306.rs:32:8
82    |
83 LL | struct S1<T, U>(T, U);
84    |        ^^

85 
86 error[E0308]: mismatched types
-   --> $DIR/generic-struct-self-unconstrained-inference-vars-6930:34:27
+   --> $DIR/generic-struct-self-unconstrained-inference-vars-69306.rs:34:27
88    |
89 LL | impl<T> S1<T, u8> {
90    |      - found this type parameter

95               found struct `S1<T, _>`
96 
97 error[E0308]: mismatched types
-   --> $DIR/generic-struct-self-unconstrained-inference-vars-6930:42:14
+   --> $DIR/generic-struct-self-unconstrained-inference-vars-69306.rs:42:14
99    |
---
To only update this specific test, also pass `--test-args generics/generic-struct-self-unconstrained-inference-vars-69306.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/generics/generic-struct-self-unconstrained-inference-vars-69306.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/generics/generic-struct-self-unconstrained-inference-vars-69306" "-A" "unused" "-A" "internal_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[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:6:28
   |
LL | impl<T> S0<T> {
   |      - expected this type parameter
LL |     const C: S0<u8> = Self(0);
   |                       ---- ^ expected type parameter `T`, found integer
   |                       |
   |                       arguments to this function are incorrect
   |
   = note: expected type parameter `T`
                        found type `{integer}`
---
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:6:23
   |
LL | impl<T> S0<T> {
   |      - found this type parameter
LL |     const C: S0<u8> = Self(0);
   |                       ^^^^^^^ expected `S0<u8>`, found `S0<T>`
   |
   = note: expected struct `S0<u8>`
              found struct `S0<T>`

error[E0308]: mismatched types
---

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:28:14
   |
LL | impl<T> Foo<T> for <S0<T> as Fun>::Out {
   |      - expected this type parameter
LL |     fn foo() {
LL |         Self(0); //~ ERROR mismatched types
   |         ---- ^ expected type parameter `T`, found integer
   |         |
   |         arguments to this function are incorrect
---

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:34:32
   |
LL | impl<T> S1<T, u8> {
   |      - expected this type parameter
LL |     const C: S1<u8, u8> = Self(0, 1);
   |                           ---- ^ expected type parameter `T`, found integer
   |                           |
   |                           arguments to this function are incorrect
   |
   = note: expected type parameter `T`
                        found type `{integer}`
note: tuple struct defined here
  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:32:8
   |
LL | struct S1<T, U>(T, U);
   |        ^^

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:34:27
   |
LL | impl<T> S1<T, u8> {
   |      - found this type parameter
LL |     const C: S1<u8, u8> = Self(0, 1);
   |                           ^^^^^^^^^^ expected `S1<u8, u8>`, found `S1<T, u8>`
   |
   = note: expected struct `S1<u8, _>`
              found struct `S1<T, _>`

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:42:14
   |
LL | impl<T> S2<T> {
   |      - expected type parameter
LL |     fn map<U>(x: U) -> S2<U> {
   |            - found type parameter
LL |         Self(x)
   |         ---- ^ expected type parameter `T`, found type parameter `U`
   |         |
   |         arguments to this function are incorrect
---
##[error]  --> /checkout/tests/ui/generics/generic-struct-self-unconstrained-inference-vars-69306.rs:42:9
   |
LL | impl<T> S2<T> {
   |      - found type parameter
LL |     fn map<U>(x: U) -> S2<U> {
   |            -           ----- expected `S2<U>` because of return type
   |            |
   |            expected type parameter
LL |         Self(x)
   |         ^^^^^^^ expected `S2<U>`, found `S2<T>`
   |
   = note: expected struct `S2<U>`
              found struct `S2<T>`
   = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
   = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters

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.

4 participants