Commit Graph

303456 Commits

Author SHA1 Message Date
Laurențiu Nicola
7104efa579 Merge pull request #19595 from Kobzol/ci-linux-pgo
Use PGO on Linux x64 builds
2025-04-15 18:51:24 +00:00
Michael Goulet
11e5987d01 Don't compute name of associated item if it's an RPITIT 2025-04-15 18:46:26 +00:00
roifewu
6c8238059f feat: enhance signature help to display generic parameters for callables and default values for generic args 2025-04-16 02:41:08 +08:00
Samuel Tardieu
9663da39d2 Run UI tests in edition 2024 mode (#14602)
The `ui_test` package runs test in edition 2021 mode by default. This PR
switches our tests to edition 2024. The commits progressively make our
test suite compatible with both edition 2021 and edition 2024, then
switches the testing mode to edition 2024, which is compatible with what
`cargo dev lint` also uses by default.

The changes are (without functionality changes in tests):
- Add `unsafe` when [calling unsafe constructs inside `unsafe
fn`](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html),
to [unsafe
attributes](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html),
and to [`extern`
blocks](https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html).
- Use stricter reference patterns to accomodate with the [new match
ergonomics
rules](https://doc.rust-lang.org/edition-guide/rust-2024/match-ergonomics.html).
- Add some `use<>` markers where required to keep the same semantics
under the [new RPIT lifetime
rules](https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html).

Some other changes ensure that non-regression tests are still enforced:
- Add edition 2021 specific tests when switching rules would make some
explicitly tested constructs untested, or when the test require using
the older [temporary tail expression scoping
rules](https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html).
- In `misnamed_getters`, check that getters containing an `unsafe` block
(for example a getter on an `Union` field) trigger the lint.

The last commit switches the default edition for running UI tests to
edition 2024.

changelog: [`misnamed_getters`]: getters containing an `unsafe` block
are also linted
2025-04-15 18:37:41 +00:00
Samuel Tardieu
c7640e0f83 Run UI tests with edition 2024 by default
The `ui_test` crate still uses 2021 as the default edition for running
rustc-like tests. This creates an unwelcome discrepancy between
`cargo dev lint` which uses Rust 2024 by default, and running UI tests
through `compile-test`.
2025-04-15 20:33:01 +02:00
Samuel Tardieu
ecd20250bc Add search_is_some_fixable_* edition 2021 specific tests 2025-04-15 20:33:01 +02:00
Samuel Tardieu
62a9cad8f1 Add needless_pass_by_ref_mut edition 2021 specific test
There is a specific test that `unsafe fn` are not lint, and that
`unsafe` blocks are not lint either. Since in edition 2024 `unsafe`
blocks are required inside `unsafe fn` to do unsafe things, set up a
specific test for edition 2021.
2025-04-15 20:33:01 +02:00
Samuel Tardieu
cd26de607a misnamed_getters: support unsafe blocks around getters
In edition 2024, `unsafe` blocks must be used inside `unsafe fn` to do
unsafe things. The `misnamed_getters` would not lint if the getter
expression was embedded inside an `unsafe` block.
2025-04-15 20:33:01 +02:00
Samuel Tardieu
20649a87d1 Add use<> markers for edition 2024 compatibility
By default, edition 2024 will capture all types and lifetimes present in
the function signature when using RPIT, while edition 2021 will capture
only the lifetimes present in the RPIT itself. Adding explicit `use<>`
markers will disable the edition-specific automatic rules when they
differ.
2025-04-15 20:33:01 +02:00
Samuel Tardieu
443547425d Use reference patterns compatible with edition 2024
Reference patterns have become stricter in edition 2024. The binding
modes cannot be mixed.
2025-04-15 20:33:01 +02:00
Samuel Tardieu
67d5056f03 Add blocks_in_conditions edition 2021 specific tests
The borrowing rules in Rust 2024 prevented those tests from compiling.
2025-04-15 20:33:01 +02:00
Samuel Tardieu
b3d401ecb1 Add unsafe markers to accomodate edition 2024 rules
- Add `unsafe` blocks inside `unsafe fn` using unsafe constructs
- Add `unsafe` qualifier to `extern` blocks
- Add `unsafe` qualifier to `no_mangle` attributes
2025-04-15 20:33:01 +02:00
Jakub Beránek
950eba8b2a Use PGO on Linux x64 builds 2025-04-15 20:32:23 +02:00
Michael Goulet
c774adcbb5 Split TypeFolder and FallibleTypeFolder 2025-04-15 18:30:35 +00:00
Manish Goregaokar
459897bab1 missing_asserts_for_indexing: consider assert_eq!() as well (#14258)
`assert_eq!()` and `assert_ne!()` are not expanded the same way as
`assert!()` (they use a `match` instead of a `if`). This makes them
being recognized as well.

Fix rust-lang/rust-clippy#14255

changelog: [`missing_asserts_for_indexing`]: consider `assert_eq!()` as
well
2025-04-15 18:11:36 +00:00
Laurențiu Nicola
88723b66d3 Merge pull request #19585 from Kobzol/pgo-windows
Allow training PGO on a custom crate and enable it Windows on CI
2025-04-15 18:10:59 +00:00
Vadim Petrochenkov
38f7060a73 Revert "Deduplicate template parameter creation"
This reverts commit 6adc2c1fd6.
2025-04-15 21:00:11 +03:00
Josh Triplett
043c5ff982 Add warning comment to Take::get_ref and Chain::get_ref
The methods `Take::get_mut` and `Chain::get_mut` include comments
warning about modifying the I/O state of the underlying reader. However,
many readers (e.g. `File`) allow I/O using a shared reference (e.g.
`&File`). So, add the same caveat to the `get_ref` methods.
2025-04-15 10:54:08 -07:00
Samuel Tardieu
e0c8b4bf53 Replace stray println!() in lint code by bug!()
To avoid crashing Clippy, the `bug!()` is used only when debug assertions are
enabled. In regular usage, the result will be the same as before, but without
the extra line printed on the standard output which has the potential for
disrupting shell scripts.
2025-04-15 19:50:14 +02:00
onur-ozkan
6d52b51d3e add comment in TomlConfig::merge about the merge order
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 19:10:31 +03:00
bors
414da5b63d Auto merge of #138906 - thaliaarchi:unsupported-test-exe, r=bjorn3
Reject test executables when not supported by target

Currently, compiling tests for SOLID produces an ICE, because SOLID does not support executables.

See https://github.com/rust-lang/rust/issues/138047
2025-04-15 16:05:15 +00:00
Mara Bos
c5c93626a0 Stabilize proc_macro::Span::{start, end, line, column}. 2025-04-15 17:29:04 +02:00
reddevilmidzy
812095031b Add test for issue 125668 2025-04-15 23:51:10 +09:00
Jason Newcomb
52694034ba Add copy_within to IndexSlice 2025-04-15 10:44:28 -04:00
Laurențiu Nicola
a6e7f0747e Merge pull request #19586 from Kobzol/manylinux-instead-of-zigbuild
Use a Docker container instead of Zig for building with old(er) glibc on x64 Linux
2025-04-15 14:10:13 +00:00
León Orell Valerian Liehr
307a67a02a Replace flag --doctest-compilation-args with a simpler one: --doctest-build-arg
More notably, the value of the new flag does *not* get lexed shell-like and ad hoc.
2025-04-15 15:44:45 +02:00
Jakub Beránek
4b5126e8b8 Use manylinux Docker container instead of zigbuild for x64 Linux
This gets us glibc 2.28 without using `cargo zigbuild`, which is not compatible with PGO.
2025-04-15 15:42:40 +02:00
Waffle Lapkin
8934ac5759 add a comment for code that isn't 2025-04-15 15:02:05 +02:00
Waffle Lapkin
dda4d7bc44 slightly correct comments and diagnostics about checking modifications
I feel like they are still wrong, but maybe less so .-.

The `info:` was unhelpful -- we only use upstream in CI nowdays.
2025-04-15 15:02:05 +02:00
Waffle Lapkin
52f4b16075 use helper function instead of writing rustfmt stamp by hand 2025-04-15 15:02:05 +02:00
Waffle Lapkin
502b630cd1 tidy: don't crush on non-existent submodules 2025-04-15 15:01:56 +02:00
Oli Scherer
f3d913d103 Merge pull request #4260 from CraftSpider/windows-file-delete
Implement file deletion on Windows
2025-04-15 12:34:21 +00:00
Jakub Beránek
3c01dfe2ae Rename is_builder_target to is_host_target 2025-04-15 14:13:53 +02:00
Jakub Beránek
2907ab5bf9 Move is_builder_target, is_system_llvm and is_rust_llvm from Builder to Config 2025-04-15 14:12:48 +02:00
Victor Farazdagi
e2422a618d new lint: redundant_test_prefix 2025-04-15 14:42:09 +03:00
Obei Sideg
ee53c26b41 Add explicit_extern_abis unstable feature
also add `explicit-extern-abis` feature section to
the unstable book.
2025-04-15 14:33:19 +03:00
bors
40dacd50b7 Auto merge of #139632 - Darksonn:cfi-fmt, r=m-ou-se
cfi: do not transmute function pointers in formatting code

Follow-up to #115954.
Addresses #115199 point 2.
Related to #128728.
Discussion [on the LKML](https://lore.kernel.org/all/20250410115420.366349-1-panikiel@google.com/).

cc `@maurer` `@rcvalle` `@RalfJung`
2025-04-15 11:11:31 +00:00
Jakub Beránek
2110265577 Use -q to silence RA output 2025-04-15 12:46:56 +02:00
MarcoIeni
73065b9484 CI: rename MacOS runner 2025-04-15 12:28:32 +02:00
Jakub Beránek
ad7a8a43c5 Run PGO for Windows on CI 2025-04-15 12:18:09 +02:00
Jakub Beránek
d959d01516 Allow passing a specific crate for PGO training 2025-04-15 11:25:16 +02:00
Jakub Beránek
38eea1b0bf Fix llvm-profdata extension on non Linux OSes 2025-04-15 11:19:37 +02:00
Mara Bos
1ca9300989 Update tests. 2025-04-15 11:14:23 +02:00
Mara Bos
d20b270b4e Don't name macro internals in "does not live long enough" errors. 2025-04-15 11:14:23 +02:00
Mara Bos
1dd77cd24a Implement pin!() using super let. 2025-04-15 11:14:21 +02:00
onur-ozkan
7dfb457745 add FIXME note in TomlConfig::merge
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:53:21 +03:00
onur-ozkan
8e6f50bb4d fix path and the ordering logic
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:15 +03:00
onur-ozkan
3f70f197f2 apply nit notes
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:11 +03:00
onur-ozkan
78cb4538ee document include in bootstrap.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:06 +03:00
onur-ozkan
4e80659b32 implement cyclic inclusion handling
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15 11:33:01 +03:00