Suggest Replacing Comma with Semicolon in Incorrect Repeat Expressions
Fixes #80173
This PR detects typos in repeat expressions like ["_", 10] and vec![String::new(), 10] and suggests replacing comma with semicolon.
Also, improves code in other place by adding doc comments and making use of a helper function to check if a type implements Clone.
References:
- For
vec![T; N]: https://doc.rust-lang.org/std/macro.vec.html - For
[T; N]: https://doc.rust-lang.org/std/primitive.array.html
r? @petrochenkov
rustbot has assigned @petrochenkov. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
------
> importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:3aacb9c90579defe09351ac5e8ee504359f8054da6326ff19038f1b7c90e3cb2aafe33685c6d9b76ee8d2ccbd187ca80c46ab5380485abdd8c0ce7d69cd8d8fd:
------
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
1 error[E0308]: mismatched types
2 --> $DIR/typo-in-repeat-expr-issue-80173.rs:15:19
3 |
- LL | let a = ["a", 10];
+ LL | let a = ["a", 10];
5 | ^^ expected `&str`, found integer
7 help: replace comma with semicolon to create an array
8 |
8 |
- LL | let a = ["a"; 10];
+ LL | let a = ["a"; 10];
11
12 error[E0308]: mismatched types
13 --> $DIR/typo-in-repeat-expr-issue-80173.rs:20:20
13 --> $DIR/typo-in-repeat-expr-issue-80173.rs:20:20
14 |
- LL | let b = [Type, size_b];
+ LL | let b = [Type, size_b];
16 | ^^^^^^ expected `Type`, found `usize`
18 help: replace comma with semicolon to create an array
19 |
19 |
- LL | let b = [Type; size_b];
+ LL | let b = [Type; size_b];
22
23 error[E0308]: mismatched types
24 --> $DIR/typo-in-repeat-expr-issue-80173.rs:25:20
24 --> $DIR/typo-in-repeat-expr-issue-80173.rs:25:20
25 |
- LL | let c = [Type, size_c];
+ LL | let c = [Type, size_c];
27 | ^^^^^^ expected `Type`, found `usize`
29 error[E0308]: mismatched types
35 error[E0308]: mismatched types
36 --> $DIR/typo-in-repeat-expr-issue-80173.rs:32:29
36 --> $DIR/typo-in-repeat-expr-issue-80173.rs:32:29
37 |
- LL | let e = [String::new(), 10];
+ LL | let e = [String::new(), 10];
39 | ^^- help: try using a conversion method: `.to_string()`
41 | expected `String`, found integer
43 error[E0308]: mismatched types
44 --> $DIR/typo-in-repeat-expr-issue-80173.rs:36:19
44 --> $DIR/typo-in-repeat-expr-issue-80173.rs:36:19
45 |
- LL | let f = ["f", get_size()];
+ LL | let f = ["f", get_size()];
47 | ^^^^^^^^^^ expected `&str`, found `usize`
49 help: replace comma with semicolon to create an array
50 |
50 |
- LL | let f = ["f"; get_size()];
+ LL | let f = ["f"; get_size()];
53
54 error[E0308]: mismatched types
55 --> $DIR/typo-in-repeat-expr-issue-80173.rs:40:19
55 --> $DIR/typo-in-repeat-expr-issue-80173.rs:40:19
56 |
- LL | let m = ["m", get_dyn_size()];
+ LL | let m = ["m", get_dyn_size()];
58 | ^^^^^^^^^^^^^^ expected `&str`, found `usize`
60 error[E0308]: mismatched types
61 --> $DIR/typo-in-repeat-expr-issue-80173.rs:44:33
62 |
62 |
- LL | let g = vec![String::new(), 10];
+ LL | let g = vec![String::new(), 10];
64 | ^^ expected `String`, found integer
66 help: replace comma with semicolon to create a vector
67 |
67 |
- LL | let g = vec![String::new(); 10];
+ LL | let g = vec![String::new(); 10];
70
71 error[E0308]: mismatched types
72 --> $DIR/typo-in-repeat-expr-issue-80173.rs:49:24
72 --> $DIR/typo-in-repeat-expr-issue-80173.rs:49:24
73 |
- LL | let h = vec![Type, dyn_size];
+ LL | let h = vec![Type, dyn_size];
75 | ^^^^^^^^ expected `Type`, found integer
77 help: replace comma with semicolon to create a vector
78 |
78 |
- LL | let h = vec![Type; dyn_size];
+ LL | let h = vec![Type; dyn_size];
81
82 error[E0308]: mismatched types
93 error[E0308]: mismatched types
93 error[E0308]: mismatched types
94 --> $DIR/typo-in-repeat-expr-issue-80173.rs:57:23
95 |
- LL | let k = vec!['c', 10];
+ LL | let k = vec!['c', 10];
97 | ^^ expected `char`, found `u8`
99 help: replace comma with semicolon to create a vector
100 |
100 |
- LL | let k = vec!['c'; 10];
+ LL | let k = vec!['c'; 10];
103
104 error[E0308]: mismatched types
116 error[E0308]: mismatched types
116 error[E0308]: mismatched types
117 --> $DIR/typo-in-repeat-expr-issue-80173.rs:68:24
118 |
- LL | let h = vec![Type, byte_size];
+ LL | let h = vec![Type, byte_size];
120 | ^^^^^^^^^ expected `Type`, found `u8`
122 error: aborting due to 14 previous errors
The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repeat-expr/typo-in-repeat-expr-issue-80173/typo-in-repeat-expr-issue-80173.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args repeat-expr/typo-in-repeat-expr-issue-80173.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(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/x86_64-unknown-linux-gnu/test/ui/repeat-expr/typo-in-repeat-expr-issue-80173" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repeat-expr/typo-in-repeat-expr-issue-80173/auxiliary"
--- stderr -------------------------------
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:15:19
|
|
LL | let a = ["a", 10];
| ^^ expected `&str`, found integer
help: replace comma with semicolon to create an array
|
|
LL | let a = ["a"; 10];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:20:20
|
|
LL | let b = [Type, size_b];
| ^^^^^^ expected `Type`, found `usize`
help: replace comma with semicolon to create an array
|
|
LL | let b = [Type; size_b];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:25:20
|
|
LL | let c = [Type, size_c];
| ^^^^^^ expected `Type`, found `usize`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:29:20
|
|
LL | let d = [Type, size_d];
| ^^^^^^ expected `Type`, found `bool`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:32:29
|
|
LL | let e = [String::new(), 10];
| ^^- help: try using a conversion method: `.to_string()`
| expected `String`, found integer
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:36:19
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:36:19
|
LL | let f = ["f", get_size()];
| ^^^^^^^^^^ expected `&str`, found `usize`
help: replace comma with semicolon to create an array
|
|
LL | let f = ["f"; get_size()];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:40:19
|
|
LL | let m = ["m", get_dyn_size()];
| ^^^^^^^^^^^^^^ expected `&str`, found `usize`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:44:33
|
|
LL | let g = vec![String::new(), 10];
| ^^ expected `String`, found integer
help: replace comma with semicolon to create a vector
|
|
LL | let g = vec![String::new(); 10];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:49:24
|
|
LL | let h = vec![Type, dyn_size];
| ^^^^^^^^ expected `Type`, found integer
help: replace comma with semicolon to create a vector
|
|
LL | let h = vec![Type; dyn_size];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:53:24
|
|
LL | let i = vec![Type, get_dyn_size()];
| ^^^^^^^^^^^^^^ expected `Type`, found `usize`
help: replace comma with semicolon to create a vector
|
|
LL | let i = vec![Type; get_dyn_size()];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:57:23
|
|
LL | let k = vec!['c', 10];
| ^^ expected `char`, found `u8`
help: replace comma with semicolon to create a vector
|
|
LL | let k = vec!['c'; 10];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:61:24
|
|
LL | let j = vec![Type, 10_u8];
| ^^^^^ expected `Type`, found `u8`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:64:27
|
|
LL | let l = vec![NewType, 10];
| ^^ expected `NewType`, found integer
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:68:24
|
|
LL | let h = vec![Type, byte_size];
| ^^^^^^^^^ expected `Type`, found `u8`
error: aborting due to 14 previous errors
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
r? compiler
:umbrella: The latest upstream changes (presumably #125443) made this pull request unmergeable. Please resolve the merge conflicts.
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
#16 2.643 Building wheels for collected packages: reuse
#16 2.644 Building wheel for reuse (pyproject.toml): started
#16 2.890 Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 2.891 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#16 2.891 Stored in directory: /tmp/pip-ephem-wheel-cache-jb8qb_1v/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 2.894 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.291 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#16 3.291 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#16 DONE 3.4s
---
Compiling field-offset v0.3.6
error[E0433]: failed to resolve: use of undeclared type `LitIntType`
--> compiler/rustc_hir/src/hir.rs:1816:39
|
1816 | node: LitKind::Int(_, LitIntType::Unsuffixed | LitIntType::Unsigned(UintTy::Usize)),
| ^^^^^^^^^^ use of undeclared type `LitIntType`
help: consider importing one of these items
|
1 + use crate::hir::ast::LitIntType;
|
|
1 + use rustc_ast::LitIntType;
|
error[E0433]: failed to resolve: use of undeclared type `LitIntType`
--> compiler/rustc_hir/src/hir.rs:1816:64
|
1816 | node: LitKind::Int(_, LitIntType::Unsuffixed | LitIntType::Unsigned(UintTy::Usize)),
| ^^^^^^^^^^ use of undeclared type `LitIntType`
help: consider importing one of these items
|
1 + use crate::hir::ast::LitIntType;
|
@fmease friendly bump
r? compiler
:umbrella: The latest upstream changes (presumably #131724) made this pull request unmergeable. Please resolve the merge conflicts.
The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Compiling rustc_hir v0.0.0 (/checkout/compiler/rustc_hir)
error[E0433]: failed to resolve: use of undeclared type `LitIntType`
--> compiler/rustc_hir/src/hir.rs:1837:39
|
1837 | node: LitKind::Int(_, LitIntType::Unsuffixed | LitIntType::Unsigned(UintTy::Usize)),
| ^^^^^^^^^^ use of undeclared type `LitIntType`
help: consider importing one of these enums
|
1 + use crate::hir::ast::LitIntType;
|
|
1 + use rustc_ast::LitIntType;
|
error[E0433]: failed to resolve: use of undeclared type `LitIntType`
--> compiler/rustc_hir/src/hir.rs:1837:64
|
1837 | node: LitKind::Int(_, LitIntType::Unsuffixed | LitIntType::Unsigned(UintTy::Usize)),
| ^^^^^^^^^^ use of undeclared type `LitIntType`
help: consider importing one of these enums
|
1 + use crate::hir::ast::LitIntType;
|
The job mingw-check-tidy failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
--stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---
#13 2.919 Building wheels for collected packages: reuse
#13 2.920 Building wheel for reuse (pyproject.toml): started
#13 3.172 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.173 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132720 sha256=026f3bb0f1aa8090b861fd0a0939cb1a782396d84c8aab7875096557d637a0f6
#13 3.173 Stored in directory: /tmp/pip-ephem-wheel-cache-ntfwq7dk/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.176 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.570 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#13 3.570 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#13 4.113 Collecting virtualenv
#13 4.113 Collecting virtualenv
#13 4.164 Downloading virtualenv-20.26.6-py3-none-any.whl (6.0 MB)
#13 4.400 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.0/6.0 MB 25.6 MB/s eta 0:00:00
#13 4.448 Collecting distlib<1,>=0.3.7
#13 4.455 Downloading distlib-0.3.9-py2.py3-none-any.whl (468 kB)
#13 4.466 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 469.0/469.0 KB 53.9 MB/s eta 0:00:00
#13 4.503 Collecting platformdirs<5,>=3.9.1
#13 4.511 Downloading platformdirs-4.3.6-py3-none-any.whl (18 kB)
#13 4.549 Collecting filelock<4,>=3.12.2
#13 4.557 Downloading filelock-3.16.1-py3-none-any.whl (16 kB)
#13 4.638 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.827 Successfully installed distlib-0.3.9 filelock-3.16.1 platformdirs-4.3.6 virtualenv-20.26.6
#13 DONE 4.9s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 206784 kB
DirectMap2M: 10278912 kB
DirectMap1G: 8388608 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
downloading https://static.rust-lang.org/dist/2024-09-22/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/2024-09-22/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt
---
fmt check
Diff in /checkout/compiler/rustc_hir/src/hir.rs:3:
use rustc_ast::util::parser::ExprPrecedence;
use rustc_ast::{
self as ast, Attribute, FloatTy, InlineAsmOptions, InlineAsmTemplatePiece, IntTy, Label,
- LitKind, TraitObjectSyntax, UintTy, LitIntType,
+ LitIntType, LitKind, TraitObjectSyntax, UintTy,
pub use rustc_ast::{
pub use rustc_ast::{
BinOp, BinOpKind, BindingMode, BorrowKind, ByRef, CaptureBy, ImplPolarity, IsAuto, Movability,
fmt error: Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/library/std/src/sys/anonymous_pipe/windows.rs" "/checkout/library/std/src/sys/anonymous_pipe/unix.rs" "/checkout/library/std/src/sys/anonymous_pipe/unsupported.rs" "/checkout/library/std/src/sys/anonymous_pipe/mod.rs" "/checkout/library/std/src/sys/personality/emcc.rs" "/checkout/library/std/src/sys/personality/gcc.rs" "/checkout/library/std/src/sys/personality/dwarf/eh.rs" "/checkout/library/std/src/sys/personality/dwarf/tests.rs" "/checkout/library/std/src/sys/personality/dwarf/mod.rs" "/checkout/library/std/src/sys/personality/mod.rs" "/checkout/library/std/src/sys/backtrace.rs" "/checkout/compiler/rustc_hir/src/stable_hash_impls.rs" "/checkout/compiler/rustc_hir/src/weak_lang_items.rs" "/checkout/compiler/rustc_hir/src/def_path_hash_map.rs" "/checkout/compiler/rustc_hir/src/definitions.rs" "/checkout/compiler/rustc_hir/src/tests.rs" "/checkout/compiler/rustc_hir/src/pat_util.rs" "/checkout/compiler/rustc_hir/src/hir_id.rs" "/checkout/compiler/rustc_hir/src/lang_items.rs" "/checkout/compiler/rustc_hir/src/lib.rs" "/checkout/compiler/rustc_hir/src/intravisit.rs" "/checkout/compiler/rustc_hir/src/target.rs" "/checkout/compiler/rustc_hir/src/diagnostic_items.rs" "/checkout/compiler/rustc_hir/src/hir.rs" "/checkout/compiler/rustc_hir/src/def.rs" "/checkout/compiler/rustc_hir/src/arena.rs" "/checkout/compiler/rustc_lint_defs/src/builtin.rs" "/checkout/compiler/rustc_lint_defs/src/lib.rs" "/checkout/library/std/src/sys/alloc/windows.rs" "/checkout/library/std/src/sys/alloc/zkvm.rs" "/checkout/library/std/src/sys/alloc/windows/tests.rs" "/checkout/library/std/src/sys/alloc/hermit.rs" "/checkout/library/std/src/sys/alloc/unix.rs" "/checkout/library/std/src/sys/alloc/solid.rs" "/checkout/library/std/src/sys/alloc/xous.rs" "/checkout/library/std/src/sys/alloc/wasm.rs" "/checkout/library/std/src/sys/alloc/sgx.rs" "/checkout/library/std/src/sys/alloc/uefi.rs" "/checkout/library/std/src/sys/alloc/mod.rs" "/checkout/compiler/stable_mir/src/ty.rs" "/checkout/compiler/stable_mir/src/abi.rs" "/checkout/compiler/stable_mir/src/mir.rs" "/checkout/compiler/stable_mir/src/crate_def.rs" "/checkout/compiler/stable_mir/src/compiler_interface.rs" "/checkout/compiler/stable_mir/src/lib.rs" "/checkout/compiler/stable_mir/src/visitor.rs" "/checkout/compiler/stable_mir/src/target.rs" "/checkout/library/std/src/sys/path/unsupported_backslash.rs" "/checkout/library/std/src/sys/path/windows.rs" "/checkout/library/std/src/sys/path/windows/tests.rs" "/checkout/library/std/src/sys/path/unix.rs" "/checkout/library/std/src/sys/path/sgx.rs" "/checkout/library/std/src/sys/path/mod.rs" "/checkout/library/std/src/sys/exit_guard.rs" "/checkout/compiler/stable_mir/src/mir/mono.rs" "/checkout/compiler/stable_mir/src/mir/body.rs" "/checkout/compiler/stable_mir/src/mir/alloc.rs" "/checkout/compiler/stable_mir/src/mir/visit.rs" "/checkout/compiler/stable_mir/src/mir/pretty.rs" "/checkout/compiler/stable_mir/src/error.rs" "/checkout/library/std/src/sys/thread_local/destructors/list.rs" "/checkout/library/std/src/sys/thread_local/destructors/linux_like.rs" "/checkout/library/std/src/sys/thread_local/os.rs" "/checkout/compiler/rustc_query_system/src/error.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
local time: Tue Oct 15 15:48:49 UTC 2024
network time: Tue, 15 Oct 2024 15:48:49 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
------
> importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:c32c805632780b5c1de330e3f44561b336c2efe163bc0990acb392390157a8e1d9f855d75914a239aa40c49d77f4a837247d05d2f8d46f554b98e1f46712a3e3:
------
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
---- [ui] tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs stdout ----
diff of stderr:
4 LL | let a = ["a", 10];
5 | ^^ expected `&str`, found integer
- help: replace comma with semicolon to create an array
+ help: replace the comma with a semicolon to create an array
8 |
8 |
9 LL | let a = ["a"; 10];
15 LL | let b = [Type, size_b];
16 | ^^^^^^ expected `Type`, found `usize`
- help: replace comma with semicolon to create an array
+ help: replace the comma with a semicolon to create an array
19 |
19 |
20 LL | let b = [Type; size_b];
46 LL | let f = ["f", get_size()];
47 | ^^^^^^^^^^ expected `&str`, found `usize`
- help: replace comma with semicolon to create an array
+ help: replace the comma with a semicolon to create an array
50 |
50 |
51 LL | let f = ["f"; get_size()];
63 LL | let g = vec![String::new(), 10];
64 | ^^ expected `String`, found integer
- help: replace comma with semicolon to create a vector
+ help: replace the comma with a semicolon to create a vector
67 |
67 |
68 LL | let g = vec![String::new(); 10];
74 LL | let h = vec![Type, dyn_size];
75 | ^^^^^^^^ expected `Type`, found integer
- help: replace comma with semicolon to create a vector
+ help: replace the comma with a semicolon to create a vector
78 |
78 |
79 LL | let h = vec![Type; dyn_size];
85 LL | let i = vec![Type, get_dyn_size()];
86 | ^^^^^^^^^^^^^^ expected `Type`, found `usize`
- help: replace comma with semicolon to create a vector
+ help: replace the comma with a semicolon to create a vector
89 |
89 |
90 LL | let i = vec![Type; get_dyn_size()];
96 LL | let k = vec!['c', 10];
97 | ^^ expected `char`, found `u8`
- help: replace comma with semicolon to create a vector
+ help: replace the comma with a semicolon to create a vector
100 |
100 |
101 LL | let k = vec!['c'; 10];
The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repeat-expr/typo-in-repeat-expr-issue-80173/typo-in-repeat-expr-issue-80173.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args repeat-expr/typo-in-repeat-expr-issue-80173.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(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/x86_64-unknown-linux-gnu/test/ui/repeat-expr/typo-in-repeat-expr-issue-80173" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repeat-expr/typo-in-repeat-expr-issue-80173/auxiliary"
--- stderr -------------------------------
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:15:19
|
|
LL | let a = ["a", 10];
| ^^ expected `&str`, found integer
help: replace the comma with a semicolon to create an array
|
|
LL | let a = ["a"; 10];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:20:20
|
|
LL | let b = [Type, size_b];
| ^^^^^^ expected `Type`, found `usize`
help: replace the comma with a semicolon to create an array
|
|
LL | let b = [Type; size_b];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:25:20
|
|
LL | let c = [Type, size_c];
| ^^^^^^ expected `Type`, found `usize`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:29:20
|
|
LL | let d = [Type, size_d];
| ^^^^^^ expected `Type`, found `bool`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:32:29
|
|
LL | let e = [String::new(), 10];
| ^^- help: try using a conversion method: `.to_string()`
| expected `String`, found integer
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:36:19
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:36:19
|
LL | let f = ["f", get_size()];
| ^^^^^^^^^^ expected `&str`, found `usize`
help: replace the comma with a semicolon to create an array
|
|
LL | let f = ["f"; get_size()];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:40:19
|
|
LL | let m = ["m", get_dyn_size()];
| ^^^^^^^^^^^^^^ expected `&str`, found `usize`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:44:33
|
|
LL | let g = vec![String::new(), 10];
| ^^ expected `String`, found integer
help: replace the comma with a semicolon to create a vector
|
|
LL | let g = vec![String::new(); 10];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:49:24
|
|
LL | let h = vec![Type, dyn_size];
| ^^^^^^^^ expected `Type`, found integer
help: replace the comma with a semicolon to create a vector
|
|
LL | let h = vec![Type; dyn_size];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:53:24
|
|
LL | let i = vec![Type, get_dyn_size()];
| ^^^^^^^^^^^^^^ expected `Type`, found `usize`
help: replace the comma with a semicolon to create a vector
|
|
LL | let i = vec![Type; get_dyn_size()];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:57:23
|
|
LL | let k = vec!['c', 10];
| ^^ expected `char`, found `u8`
help: replace the comma with a semicolon to create a vector
|
|
LL | let k = vec!['c'; 10];
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:61:24
|
|
LL | let j = vec![Type, 10_u8];
| ^^^^^ expected `Type`, found `u8`
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:64:27
|
|
LL | let l = vec![NewType, 10];
| ^^ expected `NewType`, found integer
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.rs:68:24
|
|
LL | let h = vec![Type, byte_size];
| ^^^^^^^^^ expected `Type`, found `u8`
error: aborting due to 14 previous errors
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
Thanks for your patience. @bors r+ rollup
:pushpin: Commit 98cc3457af5655f289dd7a9de0ff8433697ea105 has been approved by cjgillot
It is now in the queue for this repository.