Lint that warns when an elided lifetime ends up being a named lifetime
As suggested in https://github.com/rust-lang/rust/issues/48686#issuecomment-1817334575
Fixes #48686
TODO:
- [ ] Crater run?
Questions:
- [ ] Should we separate the
'staticcase and the named lifetime parameter case? - [ ] Should this be
AlloworWarnby default? - [ ] Should this be gated behind an edition?
Future improvemetns:
- [ ] Add machine-applicable suggestions
@rustbot label A-lint
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.813 Building wheels for collected packages: reuse
#13 2.815 Building wheel for reuse (pyproject.toml): started
#13 3.063 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.064 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.065 Stored in directory: /tmp/pip-ephem-wheel-cache-dacio7j1/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.067 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.471 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.471 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.010 Collecting virtualenv
#13 4.010 Collecting virtualenv
#13 4.057 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.133 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 76.7 MB/s eta 0:00:00
#13 4.177 Collecting distlib<1,>=0.3.7
#13 4.184 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.191 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 91.2 MB/s eta 0:00:00
#13 4.223 Collecting platformdirs<5,>=3.9.1
#13 4.231 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.271 Collecting filelock<4,>=3.12.2
#13 4.278 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.359 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.546 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.6s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 176064 kB
DirectMap2M: 7163904 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,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://ci-artifacts.rust-lang.org/rustc-builds-alt/9b318d2e93ce35e7ba32d8cfa96a1dbe63a7bed1/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-9b318d2e93ce35e7ba32d8cfa96a1dbe63a7bed1-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5495 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 39.6 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Sat Aug 17 19:18:11 UTC 2024
network time: Sat, 17 Aug 2024 19:18:11 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
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.849 Building wheels for collected packages: reuse
#13 2.850 Building wheel for reuse (pyproject.toml): started
#13 3.093 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.093 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.094 Stored in directory: /tmp/pip-ephem-wheel-cache-ozxd5zca/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.096 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.489 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.489 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.007 Collecting virtualenv
#13 4.007 Collecting virtualenv
#13 4.057 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.276 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 26.3 MB/s eta 0:00:00
#13 4.331 Collecting platformdirs<5,>=3.9.1
#13 4.337 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.358 Collecting distlib<1,>=0.3.7
#13 4.378 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 44.4 MB/s eta 0:00:00
#13 4.415 Collecting filelock<4,>=3.12.2
#13 4.422 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.422 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.505 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.691 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.8s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 196544 kB
DirectMap2M: 7143424 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,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://ci-artifacts.rust-lang.org/rustc-builds-alt/0f26ee4fd95a1c046582dfb18892f520788e2c2c/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-0f26ee4fd95a1c046582dfb18892f520788e2c2c-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5495 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 48.3 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Sat Aug 17 21:14:27 UTC 2024
network time: Sat, 17 Aug 2024 21:14:27 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
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.737 Building wheels for collected packages: reuse
#13 2.738 Building wheel for reuse (pyproject.toml): started
#13 2.986 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 2.987 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 2.987 Stored in directory: /tmp/pip-ephem-wheel-cache-_bs2trf1/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 2.990 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.387 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.387 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 3.912 Collecting virtualenv
#13 3.912 Collecting virtualenv
#13 3.947 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.027 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 73.6 MB/s eta 0:00:00
#13 4.080 Collecting platformdirs<5,>=3.9.1
#13 4.084 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.118 Collecting filelock<4,>=3.12.2
#13 4.140 Collecting distlib<1,>=0.3.7
#13 4.143 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.150 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 90.4 MB/s eta 0:00:00
#13 4.150 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 90.4 MB/s eta 0:00:00
#13 4.230 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.417 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.5s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 227264 kB
DirectMap2M: 10258432 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://ci-artifacts.rust-lang.org/rustc-builds-alt/6de928dce9472b864f4e5d590dd7aa2075cb7551/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-6de928dce9472b864f4e5d590dd7aa2075cb7551-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5495 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Using cached pip-24.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Attempting uninstall: pip
Attempting uninstall: pip
Found existing installation: pip 24.1
Uninstalling pip-24.1:
Successfully uninstalled pip-24.1
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Sun Aug 18 22:47:55 UTC 2024
network time: Sun, 18 Aug 2024 22:47:55 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
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.843 Building wheels for collected packages: reuse
#13 2.845 Building wheel for reuse (pyproject.toml): started
#13 3.103 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.104 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.104 Stored in directory: /tmp/pip-ephem-wheel-cache-bpw210dg/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.107 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.522 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.522 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.089 Collecting virtualenv
#13 4.089 Collecting virtualenv
#13 4.135 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.211 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 77.1 MB/s eta 0:00:00
#13 4.253 Collecting distlib<1,>=0.3.7
#13 4.257 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.265 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 87.1 MB/s eta 0:00:00
#13 4.295 Collecting platformdirs<5,>=3.9.1
#13 4.299 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.334 Collecting filelock<4,>=3.12.2
#13 4.337 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.423 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.615 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.7s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 210880 kB
DirectMap2M: 7129088 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,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://ci-artifacts.rust-lang.org/rustc-builds-alt/6de928dce9472b864f4e5d590dd7aa2075cb7551/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-6de928dce9472b864f4e5d590dd7aa2075cb7551-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5495 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 72.4 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Sun Aug 18 23:13:44 UTC 2024
network time: Sun, 18 Aug 2024 23:13:44 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
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 3.037 Building wheels for collected packages: reuse
#13 3.038 Building wheel for reuse (pyproject.toml): started
#13 3.296 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.297 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.297 Stored in directory: /tmp/pip-ephem-wheel-cache-xahnu1q4/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.300 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.707 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.708 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.255 Collecting virtualenv
#13 4.255 Collecting virtualenv
#13 4.309 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.479 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 34.1 MB/s eta 0:00:00
#13 4.535 Collecting platformdirs<5,>=3.9.1
#13 4.542 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.565 Collecting distlib<1,>=0.3.7
#13 4.583 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 57.8 MB/s eta 0:00:00
#13 4.619 Collecting filelock<4,>=3.12.2
#13 4.627 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.627 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.709 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.900 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 5.0s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 194496 kB
DirectMap2M: 7145472 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,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://ci-artifacts.rust-lang.org/rustc-builds-alt/6de928dce9472b864f4e5d590dd7aa2075cb7551/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-6de928dce9472b864f4e5d590dd7aa2075cb7551-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5495 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 46.4 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Mon Aug 19 00:05:31 UTC 2024
network time: Mon, 19 Aug 2024 00:05:31 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
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 3.117 Building wheels for collected packages: reuse
#13 3.118 Building wheel for reuse (pyproject.toml): started
#13 3.378 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.379 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.379 Stored in directory: /tmp/pip-ephem-wheel-cache-j0x6brsg/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.382 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.801 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.801 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.353 Collecting virtualenv
#13 4.353 Collecting virtualenv
#13 4.408 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.583 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 33.0 MB/s eta 0:00:00
#13 4.636 Collecting distlib<1,>=0.3.7
#13 4.643 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.656 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 43.7 MB/s eta 0:00:00
#13 4.697 Collecting filelock<4,>=3.12.2
#13 4.705 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.742 Collecting platformdirs<5,>=3.9.1
#13 4.750 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.832 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 5.022 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 5.1s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 208832 kB
DirectMap2M: 8179712 kB
DirectMap1G: 10485760 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.06s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/6b678c57b63b3062fb97130b3617b82657f59c80/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-6b678c57b63b3062fb97130b3617b82657f59c80-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5502 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 45.0 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Wed Aug 21 23:00:29 UTC 2024
network time: Wed, 21 Aug 2024 23:00:29 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
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.846 Building wheels for collected packages: reuse
#13 2.847 Building wheel for reuse (pyproject.toml): started
#13 3.089 Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.090 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.090 Stored in directory: /tmp/pip-ephem-wheel-cache-3lbhbu89/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.092 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.482 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.483 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.001 Collecting virtualenv
#13 4.001 Collecting virtualenv
#13 4.057 Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.262 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 28.0 MB/s eta 0:00:00
#13 4.308 Collecting distlib<1,>=0.3.7
#13 4.315 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.325 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 56.6 MB/s eta 0:00:00
#13 4.357 Collecting platformdirs<5,>=3.9.1
#13 4.364 Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.406 Collecting filelock<4,>=3.12.2
#13 4.413 Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.494 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.686 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.8s
#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k: 190400 kB
DirectMap2M: 8198144 kB
DirectMap1G: 10485760 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://ci-artifacts.rust-lang.org/rustc-builds-alt/eff09483c67e6fc96c8098ba46dce476162754c5/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-eff09483c67e6fc96c8098ba46dce476162754c5-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
fmt check
fmt: checked 5508 files
tidy check
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1868: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
##[error]tidy error: /checkout/compiler/rustc_lint_defs/src/builtin.rs:1871: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
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.1)
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 47.1 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
local time: Thu Aug 22 23:48:13 UTC 2024
network time: Thu, 22 Aug 2024 23:48:13 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
rustc_errors::translation was changed
cc @davidtwco, @compiler-errors, @TaKO8Ki
Some changes occurred in src/tools/clippy
cc @rust-lang/clippy
The Miri subtree was changed
cc @rust-lang/miri
rustc_errors::translationwas changed
- replaced some elided lifetimes with explicit ones
Some changes occurred in src/tools/clippy
- replaced some elided lifetimes with explicit ones
- blessed some tests, because there is a new lint
The Miri subtree was changed
- replaced some elided lifetimes with explicit ones
Could you submit d214d0b0f2e221fc97dee444ca1686086568f876 as a standalone PR? Is can be merged while we review this PR.
Thanks!
As for the matter with crate_node_id, it will prevent users from controlling lint behaviour using allow/deny attributes. The missing node-ids are those which correspond to a ElidedAnchor resolution.
2 alternative ideas:
- channel the correct NodeId for the lint to use;
- emit the lints when seeing the
ElidedAnchorinrecord_lifetime_res.
As for the matter with
crate_node_id, it will prevent users from controlling lint behaviour usingallow/denyattributes. The missing node-ids are those which correspond to aElidedAnchorresolution.
Ah, I was worried that it might cause some sort of a problem, and indeed it does. Oh well. I seem to have fixed it and I also added a test for this.
@rustbot author
@rustbot ready
Thanks for bearing with me through this! Do you mind adding a suggestion to this lint in a follow-up PR? @bors r+
:pushpin: Commit 3a7d0ab1c48f763765195d57d761314325ae54c0 has been approved by cjgillot
It is now in the queue for this repository.
Thanks for bearing with me through this!
Thank you for your patience and guidance, I appreciate it!
Do you mind adding a suggestion to this lint in a follow-up PR?
Yes (well, technically "No", I do not mind, heh), but a bit later as I'm going to be busy in the next couple of days.
@bors r- https://github.com/rust-lang/rust/pull/129591#issuecomment-2309044568
@GrigorenkoPV The PR description makes it look like this PR is very incomplete. This PR description will become part of the commit history of the repo when the PR is merged, so perhaps you want to update the PR description before this merges?
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.
cc @rust-lang/rust-analyzer
I've fixed the warnings in rust-analyzer and made the PR message more presentable.
@rustbot ready
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.726 Building wheels for collected packages: reuse
#16 2.728 Building wheel for reuse (pyproject.toml): started
#16 2.978 Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 2.979 Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#16 2.980 Stored in directory: /tmp/pip-ephem-wheel-cache-4azjfeny/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 2.982 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.379 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.379 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.5s
---
|
2616 | pub struct ElidedNamedLifetime {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
= help: or consider exporting it for use by other crates
= note: `-D unreachable-pub` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unreachable_pub)]`
:umbrella: The latest upstream changes (presumably #129750) made this pull request unmergeable. Please resolve the merge conflicts.
With the same idea as @saethlin's comment, could you squash the commits? To remove some back-and-forth changes. r=me then
Done!
I've squashed it into three commits:
- Implementation
- Fixing the remaining (after #129510) places in code where the lint would fire.
- Adding & blessing tests.
Great! @bors r=
:pushpin: Commit a9b959a020cc156ef57a972c83381aabc43b1174 has been approved by ``
It is now in the queue for this repository.
Typo. @bors r-
@bors r+
:pushpin: Commit a9b959a020cc156ef57a972c83381aabc43b1174 has been approved by cjgillot
It is now in the queue for this repository.