rust
rust copied to clipboard
Fix ICE when there is a continue in a labeled block
Fixes #113379 Fixes #121623
r? @matthiaskrgr
r? compiler
This needs an explanation for why it's correct. I'm also somewhat concerned that this could affect good-path code.
I'd prefer if we did something else, like lower continue
to hir::ExprKind::Error
when it's in a scope that doesn't allow breaks.
@compiler-errors I updated the pr, now when the ast is being lowered it checks if the label belongs to a loop and if it does not it will lower to an error. Should I remove this now redundant check: https://github.com/rust-lang/rust/blob/6cbf0926d54c80ea6d15df333be9281f65bbeb36/compiler/rustc_passes/src/loops.rs#L189-L194
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)
Getting action download info
Download action repository 'msys2/[email protected]' (SHA:cc11e9188b693c2b100158c3322424c4cc1dadea)
Download action repository 'actions/checkout@v4' (SHA:b4ffde65f46336ab88eb53be808477a3936bae11)
Download action repository 'actions/upload-artifact@v3' (SHA:a8a3f3ad30e3422c9c7b888a15615d19a852ae32)
Complete job name: PR - mingw-check-tidy
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=SarthakSingh31
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_ec471833-c3ad-4027-ba9b-aa1a5dbed72b
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=12e4ce04900a80fb9294078563a50b289ad95494
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_ec471833-c3ad-4027-ba9b-aa1a5dbed72b
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_ec471833-c3ad-4027-ba9b-aa1a5dbed72b
GITHUB_TRIGGERING_ACTOR=SarthakSingh31
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/121682/merge
GITHUB_WORKFLOW_SHA=12e4ce04900a80fb9294078563a50b289ad95494
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_20_X64=/opt/hostedtoolcache/go/1.20.14/x64
---
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt \
&& pip3 install virtualenv
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.
# 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
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---
#10 [5/8] COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
#10 DONE 0.0s
#11 [6/8] RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt && pip3 install virtualenv
#11 0.537 Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
#11 0.549 Collecting boolean-py==4.0
#11 0.552 Downloading boolean.py-4.0-py3-none-any.whl (25 kB)
#11 0.566 Collecting chardet==5.1.0
---
#11 3.602 Building wheels for collected packages: reuse
#11 3.603 Building wheel for reuse (pyproject.toml): started
#11 3.934 Building wheel for reuse (pyproject.toml): finished with status 'done'
#11 3.935 Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#11 3.935 Stored in directory: /tmp/pip-ephem-wheel-cache-yyj5ebcd/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#11 3.937 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#11 3.960 Attempting uninstall: setuptools
#11 3.960 Found existing installation: setuptools 59.6.0
#11 3.961 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#11 3.961 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#11 3.962 Can't uninstall 'setuptools'. No files were found to uninstall.
#11 4.638 Successfully installed binaryornot-0.4.4 boolean-py-4.0 chardet-5.1.0 jinja2-3.1.2 license-expression-30.0.0 markupsafe-2.1.1 python-debian-0.1.49 reuse-1.1.0 setuptools-66.0.0
#11 4.639 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
#11 5.158 Collecting virtualenv
#11 5.203 Downloading virtualenv-20.25.1-py3-none-any.whl (3.8 MB)
#11 5.304 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 38.4 MB/s eta 0:00:00
#11 5.340 Collecting distlib<1,>=0.3.7
#11 5.343 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#11 5.349 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 114.7 MB/s eta 0:00:00
#11 5.377 Collecting platformdirs<5,>=3.9.1
#11 5.382 Downloading platformdirs-4.2.0-py3-none-any.whl (17 kB)
#11 5.411 Collecting filelock<4,>=3.12.2
#11 5.415 Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
#11 5.501 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#11 5.668 Successfully installed distlib-0.3.8 filelock-3.13.1 platformdirs-4.2.0 virtualenv-20.25.1
#11 DONE 5.7s
#12 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#12 DONE 0.0s
---
DirectMap4k: 188352 kB
DirectMap2M: 7151616 kB
DirectMap1G: 11534336 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
Finished dev [unoptimized] target(s) in 0.03s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/6cbf0926d54c80ea6d15df333be9281f65bbeb36/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-6cbf0926d54c80ea6d15df333be9281f65bbeb36-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
##[endgroup]
fmt check
tidy check
tidy: Skipping binary file check, read-only filesystem
tidy error: /checkout/compiler/rustc_ast_lowering/messages.ftl: missing trailing newline
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (24.0)
Collecting black==23.3.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 7))
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 42.9 MB/s eta 0:00:00
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 42.9 MB/s eta 0:00:00
Collecting click==8.1.3 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 34))
Downloading click-8.1.3-py3-none-any.whl (96 kB)
Collecting importlib-metadata==6.7.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 38))
Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB)
Collecting mypy-extensions==1.0.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 42))
Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Collecting packaging==23.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 46))
Downloading packaging-23.1-py3-none-any.whl (48 kB)
Collecting pathspec==0.11.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 50))
Downloading pathspec-0.11.1-py3-none-any.whl (29 kB)
Downloading pathspec-0.11.1-py3-none-any.whl (29 kB)
Collecting platformdirs==3.6.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 54))
Downloading platformdirs-3.6.0-py3-none-any.whl (16 kB)
Collecting ruff==0.0.272 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 58))
Downloading ruff-0.0.272-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB)
Collecting tomli==2.0.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 77))
Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting typed-ast==1.5.4 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 81))
Downloading typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (877 kB)
Downloading typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (877 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 877.7/877.7 kB 133.6 MB/s eta 0:00:00
Collecting typing-extensions==4.6.3 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 107))
Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting zipp==3.15.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 114))
Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
Installing collected packages: zipp, typing-extensions, typed-ast, tomli, ruff, platformdirs, pathspec, packaging, mypy-extensions, click, importlib-metadata, black
Successfully installed black-23.3.0 click-8.1.3 importlib-metadata-6.7.0 mypy-extensions-1.0.0 packaging-23.1 pathspec-0.11.1 platformdirs-3.6.0 ruff-0.0.272 tomli-2.0.1 typed-ast-1.5.4 typing-extensions-4.6.3 zipp-3.15.0
some tidy checks failed
Build completed unsuccessfully in 0:01:00
local time: Fri Mar 1 12:09:07 UTC 2024
network time: Fri, 01 Mar 2024 12:09:07 GMT
The job x86_64-gnu-llvm-16
failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=SarthakSingh31
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_baf1f3f8-5bfb-4024-935d-02d8b3dd4c5a
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=8deeeb5076e2b9e6edee888bdfe545a4faf8fed6
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_baf1f3f8-5bfb-4024-935d-02d8b3dd4c5a
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_baf1f3f8-5bfb-4024-935d-02d8b3dd4c5a
GITHUB_TRIGGERING_ACTOR=SarthakSingh31
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/121682/merge
GITHUB_WORKFLOW_SHA=8deeeb5076e2b9e6edee888bdfe545a4faf8fed6
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_20_X64=/opt/hostedtoolcache/go/1.20.14/x64
---
#12 writing image sha256:6224c34b9dbc82d14a35aba4a1e4c67376b43a6ddb7493c4bef228a905d1ee38 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.0s
##[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-16]
##[group]Clock drift check
local time: Fri Mar 1 12:13:23 UTC 2024
network time: Fri, 01 Mar 2024 12:13:23 GMT
network time: Fri, 01 Mar 2024 12:13:23 GMT
##[endgroup]
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-16', '--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', 'build.optimized-compiler-builtins', '--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-16/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
---- [ui] tests/ui/label/label_break_value_continue.rs stdout ----
diff of stderr:
- error[E0695]: unlabeled `continue` inside of a labeled block
- |
- LL | continue;
- LL | continue;
- | ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label
-
7 error[E0696]: `continue` pointing to a labeled block
9 |
12 | | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
13 LL | | }
14 | |_____- labeled block the `continue` points to
+
+ error[E0695]: unlabeled `continue` inside of a labeled block
+ |
+ LL | continue;
+ LL | continue;
+ | ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label
15
16 error[E0695]: unlabeled `continue` inside of a labeled block
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/label/label_break_value_continue/label_break_value_continue.stderr
---
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/label/label_break_value_continue.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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--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/label/label_break_value_continue" "-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/label/label_break_value_continue/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0696]: `continue` pointing to a labeled block
|
LL | / 'b: {
LL | / 'b: {
LL | | continue 'b; //~ ERROR `continue` pointing to a labeled block
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | }
| |_____- labeled block the `continue` points to
error[E0695]: unlabeled `continue` inside of a labeled block
|
|
LL | continue; //~ ERROR unlabeled `continue` inside of a labeled block
| ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label
error[E0695]: unlabeled `continue` inside of a labeled block
|
|
LL | continue; //~ ERROR unlabeled `continue` inside of a labeled block
| ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0695, E0696.
For more information about an error, try `rustc --explain E0695`.
:umbrella: The latest upstream changes (presumably #121780) made this pull request unmergeable. Please resolve the merge conflicts.
I'm surprised we weren't emitting such an error anywhere before.
@cjgillot We were emitting this error but just much later. https://github.com/rust-lang/rust/pull/121682#issuecomment-1973074714
As asked https://github.com/rust-lang/rust/pull/121682#issuecomment-1966933228 I moved the error to when the ast is lowered.
I would also like your opinion on if it would be better to lower it to a hir::ExprKind::Continue
but the destination has a hir::LoopIdError
of something like label does not refer to a loop
.
@rustbot label -S-waiting-on-author +S-waiting-on-review
I would also like your opinion on if it would be better to lower it to a
hir::ExprKind::Continue
but the destination has ahir::LoopIdError
of something likelabel does not refer to a loop
.
Using ExprKind::Err
is fine, that's what it's meant to be.
For break
, I think some uniformity would be better. If is allows us to remove some error handling code somewhere else, that's all the better.
:umbrella: The latest upstream changes (presumably #123468) made this pull request unmergeable. Please resolve the merge conflicts.
@SarthakSingh31 any updates on this? thanks
@oskgo I had forgotten about this PR, going to try to fix it up in the next few days.
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
---
---- [ui] tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs stdout ----
diff of stderr:
17 LL | | }
18 | |_____- labeled block the `continue` points to
+ error[E0741]: `&'static str` can't be used as a const parameter type
+ --> $DIR/cont-in-fn-issue-113379.rs:4:22
+ |
+ |
+ LL | trait Trait<const S: &'static str> {}
+
20 error[E0308]: mismatched types
21 --> $DIR/cont-in-fn-issue-113379.rs:10:13
22 |
---
To only update this specific test, also pass `--test-args lowering/cont-in-block/cont-in-fn-issue-113379.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.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/lowering/cont-in-block/cont-in-fn-issue-113379" "-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/lowering/cont-in-block/cont-in-fn-issue-113379/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0696]: `continue` pointing to a labeled block
|
|
LL | / 'b: { //~ ERROR [E0308]
LL | | continue 'b; //~ ERROR [E0696]
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | }
| |_____________- labeled block the `continue` points to
error[E0696]: `continue` pointing to a labeled block
|
LL | / 'b: {
LL | | continue 'b;
LL | | continue 'b;
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | //~^ ERROR [E0696]
LL | | }
| |_____- labeled block the `continue` points to
error[E0741]: `&'static str` can't be used as a const parameter type
##[error] --> /checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs:4:22
|
|
LL | trait Trait<const S: &'static str> {}
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs:10:13
|
|
LL | / 'b: { //~ ERROR [E0308]
LL | | continue 'b; //~ ERROR [E0696]
| |_____________^ expected `&str`, found `()`
error: aborting due to 4 previous errors
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
---
##[endgroup]
##[group]Testing stage2 compiletest suite=crashes mode=crashes (x86_64-unknown-linux-gnu)
running 223 tests
...........................2024-07-22T10:05:26.551406Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge."
[crashes] tests/crashes/113379.rs ... F
............................................................ 88/223
............................................................ 88/223
..........2024-07-22T10:05:27.204355Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge."
[crashes] tests/crashes/121623.rs ... F
............................................................................. 176/223
...............................................
failures:
---- [crashes] tests/crashes/113379.rs stdout ----
error: crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge.
thread '[crashes] tests/crashes/113379.rs' panicked at src/tools/compiletest/src/runtest.rs:379:18:
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- [crashes] tests/crashes/121623.rs stdout ----
error: crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge.
thread '[crashes] tests/crashes/121623.rs' panicked at src/tools/compiletest/src/runtest.rs:379:18:
failures:
[crashes] tests/crashes/113379.rs
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
---
---- [ui] tests/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623.rs stdout ----
diff of stderr:
1 error[E0696]: `continue` pointing to a labeled block
+ --> $DIR/cont-in-match-arm-issue-121623.rs:6:13
3 |
3 |
4 LL | _ => 'b: {
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623/cont-in-match-arm-issue-121623.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623/cont-in-match-arm-issue-121623.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lowering/cont-in-block/cont-in-match-arm-issue-121623.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623.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/lowering/cont-in-block/cont-in-match-arm-issue-121623" "-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/lowering/cont-in-block/cont-in-match-arm-issue-121623/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0696]: `continue` pointing to a labeled block
|
|
LL | _ => 'b: {
LL | | continue 'b;
LL | | continue 'b;
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | //~^ ERROR [E0696]
LL | | }
| |_________- labeled block the `continue` points to
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0696`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs stdout ----
diff of stderr:
1 error[E0696]: `continue` pointing to a labeled block
+ --> $DIR/cont-in-fn-issue-113379.rs:14:17
3 |
4 LL | / 'b: {
5 LL | |
5 LL | |
9 | |_____________- labeled block the `continue` points to
10
11 error[E0696]: `continue` pointing to a labeled block
+ --> $DIR/cont-in-fn-issue-113379.rs:24:9
13 |
14 LL | / 'b: {
15 LL | | continue 'b;
15 LL | | continue 'b;
19 | |_____- labeled block the `continue` points to
21 error[E0308]: mismatched types
- --> $DIR/cont-in-fn-issue-113379.rs:10:13
+ --> $DIR/cont-in-fn-issue-113379.rs:12:13
23 |
---
To only update this specific test, also pass `--test-args lowering/cont-in-block/cont-in-fn-issue-113379.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.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/lowering/cont-in-block/cont-in-fn-issue-113379" "-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/lowering/cont-in-block/cont-in-fn-issue-113379/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0696]: `continue` pointing to a labeled block
|
LL | / 'b: {
LL | / 'b: {
LL | | //~^ ERROR [E0308]
LL | | continue 'b; //~ ERROR [E0696]
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | }
| |_____________- labeled block the `continue` points to
error[E0696]: `continue` pointing to a labeled block
|
LL | / 'b: {
LL | | continue 'b;
LL | | continue 'b;
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | //~^ ERROR [E0696]
LL | | }
| |_____- labeled block the `continue` points to
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs:12:13
|
LL | / 'b: {
LL | / 'b: {
LL | | //~^ ERROR [E0308]
LL | | continue 'b; //~ ERROR [E0696]
| |_____________^ expected `usize`, found `()`
error: aborting due to 3 previous errors
@cjgillot I have removed the redundant error. This should be ready to merge.
This does not change the break
code as the changes made here check if a label points to a block or a loop. This is important for continue
but for break
it does not matter in this case.
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
---
---- [ui] tests/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623.rs stdout ----
diff of stderr:
1 error[E0696]: `continue` pointing to a labeled block
+ --> $DIR/cont-in-match-arm-issue-121623.rs:6:13
3 |
3 |
4 LL | _ => 'b: {
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623/cont-in-match-arm-issue-121623.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623/cont-in-match-arm-issue-121623.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lowering/cont-in-block/cont-in-match-arm-issue-121623.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lowering/cont-in-block/cont-in-match-arm-issue-121623.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/lowering/cont-in-block/cont-in-match-arm-issue-121623" "-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/lowering/cont-in-block/cont-in-match-arm-issue-121623/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0696]: `continue` pointing to a labeled block
|
|
LL | _ => 'b: {
LL | | continue 'b;
LL | | continue 'b;
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | //~^ ERROR [E0696]
LL | | }
| |_________- labeled block the `continue` points to
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0696`.
------------------------------------------
------------------------------------------
---- [ui] tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs stdout ----
diff of stderr:
1 error[E0696]: `continue` pointing to a labeled block
+ --> $DIR/cont-in-fn-issue-113379.rs:14:17
3 |
4 LL | / 'b: {
5 LL | |
5 LL | |
9 | |_____________- labeled block the `continue` points to
10
11 error[E0696]: `continue` pointing to a labeled block
+ --> $DIR/cont-in-fn-issue-113379.rs:24:9
13 |
14 LL | / 'b: {
15 LL | | continue 'b;
15 LL | | continue 'b;
19 | |_____- labeled block the `continue` points to
21 error[E0308]: mismatched types
- --> $DIR/cont-in-fn-issue-113379.rs:10:13
+ --> $DIR/cont-in-fn-issue-113379.rs:12:13
23 |
---
To only update this specific test, also pass `--test-args lowering/cont-in-block/cont-in-fn-issue-113379.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.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/lowering/cont-in-block/cont-in-fn-issue-113379" "-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/lowering/cont-in-block/cont-in-fn-issue-113379/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0696]: `continue` pointing to a labeled block
|
LL | / 'b: {
LL | / 'b: {
LL | | //~^ ERROR [E0308]
LL | | continue 'b; //~ ERROR [E0696]
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | }
| |_____________- labeled block the `continue` points to
error[E0696]: `continue` pointing to a labeled block
|
LL | / 'b: {
LL | | continue 'b;
LL | | continue 'b;
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
LL | | //~^ ERROR [E0696]
LL | | }
| |_____- labeled block the `continue` points to
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/lowering/cont-in-block/cont-in-fn-issue-113379.rs:12:13
|
LL | / 'b: {
LL | / 'b: {
LL | | //~^ ERROR [E0308]
LL | | continue 'b; //~ ERROR [E0696]
| |_____________^ expected `usize`, found `()`
error: aborting due to 3 previous errors
A job failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
:umbrella: The latest upstream changes (presumably #125443) made this pull request unmergeable. Please resolve the merge conflicts.
:umbrella: The latest upstream changes (presumably #128614) made this pull request unmergeable. Please resolve the merge conflicts.
r=me after rebase