Commit Graph

291081 Commits

Author SHA1 Message Date
Matthias Krüger
3f32ff5204 Rollup merge of #141244 - RalfJung:GetUserProfileDirectoryW, r=ChrisDenton
windows: document that we rely on an undocumented property of GetUserProfileDirectoryW

r? `@ChrisDenton`
Also see https://github.com/rust-lang/miri/pull/4332
2025-05-19 18:08:41 +02:00
Matthias Krüger
8f13cbf1a5 Rollup merge of #131200 - ismailarilik:handle-potential-query-instability-lint-for-rustc-query_system, r=fee1-dead
Handle `rustc_query_system` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_query_system/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_query_system/src/lib.rs#L2) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447

r? `@compiler-errors`
2025-05-19 18:08:41 +02:00
Samuel Tardieu
e2b1de107f Access items through rustc_session instead of rustc_lint_defs
Items such as the `declare_tool_lint!()` macro are publicly reexported
from `rustc_lint_defs` to `rustc_session`. Use the latter for
consistency.
2025-05-19 18:05:34 +02:00
Mario Pastorelli
c8f5ff867d Add std::io::Seek instance for std::io::Take 2025-05-19 17:56:46 +02:00
Samuel Tardieu
db42c7dddc Remove obsolete restriction in code 2025-05-19 17:50:22 +02:00
Ralf Jung
26e917202c Merge pull request #4334 from RalfJung/GetUserProfileDirectoryW-issue
GetUserProfileDirectoryW: reference issue regarding implementation details we rely on
2025-05-19 15:38:09 +00:00
Samuel Tardieu
ebc2a68fe8 Add new useless_concat lint (#13829)
Fixes #13793.

Interestingly enough, to actually check that the macro call has at least
two arguments, we need to use the rust lexer after getting the original
source code snippet.

changelog: Add new `useless_concat` lint
2025-05-19 15:11:37 +00:00
Ralf Jung
758b7994e8 GetUserProfileDirectoryW: reference issue regarding implementation details we rely on 2025-05-19 17:08:06 +02:00
Ralf Jung
a14e25c768 windows: document that we rely on an undocumented property of GetUserProfileDirectoryW 2025-05-19 17:06:02 +02:00
Andrew Zhogin
61059282eb Warning added when dependency crate has async drop types, and the feature is disabled 2025-05-19 21:38:07 +07:00
许杰友 Jieyou Xu (Joe)
bcf2b59833 Merge pull request #2395 from smanilov/patch-10 2025-05-19 22:36:58 +08:00
Stan Manilov
4f45f0442b Update link to Forge guide on new flags 2025-05-19 17:32:29 +03:00
Ralf Jung
8d4611845d Merge pull request #4333 from RalfJung/mips-tests
run tests on mips-unknown-linux-gnu
2025-05-19 14:26:51 +00:00
dianqk
be5d6c5425 gvn: bail out unavoidable non-ssa locals in repeat
We cannot transform `*elem` to `array[idx1]` in the following code,
as `idx1` has already been modified.

```rust
    mir! {
        let array;
        let elem;
        {
            array = [*val; 5];
            elem = &array[idx1];
            idx1 = idx2;
            RET = *elem;
            Return()
        }
    }
```
2025-05-19 21:35:49 +08:00
Ralf Jung
aa4d16a1a7 run tests on mips-unknown-linux-gnu 2025-05-19 15:35:19 +02:00
Ralf Jung
26ea763f24 add this to Miri's trophy case 2025-05-19 15:22:31 +02:00
Ralf Jung
8286487c0c fix data race in ReentrantLock fallback for targets without 64bit atomics 2025-05-19 15:21:25 +02:00
Deadbeef
c5bab6e9aa introduce common macro for MutVisitor and Visitor to dedup code 2025-05-19 21:21:03 +08:00
bors
e5a2a6a15d Auto merge of #141243 - Zalathar:rollup-x5xt80l, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - #140847 (coverage: Detect unused local file IDs to avoid an LLVM assertion)
 - #141117 (opt-dist: fix deprecated BOLT -icf=1 option)
 - #141225 (more ice tests)
 - #141239 (dladdr cannot leave dli_fname to be null)
 - #141242 (in `tests/ui/asm/aarch64/parse-error.rs`, only test cases specific to that target)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-19 12:59:31 +00:00
onur-ozkan
9da637a578 skip compiler tools sanity checks on certain commands
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-19 15:42:12 +03:00
Chayim Refael Friedman
31b4808432 Fix cache problems with lints level
By removing the cache.
2025-05-19 15:36:01 +03:00
nora
f42a6e3012 Merge pull request #2394 from smanilov/patch-9
Make run instructions first
2025-05-19 14:34:27 +02:00
nora
44b91dd50c Merge pull request #2393 from smanilov/patch-8
Remove unused references and simplify one
2025-05-19 14:33:57 +02:00
Stan Manilov
114367587c Make run instructions first
Better, because then one knows how to run the examples.
2025-05-19 14:44:36 +03:00
Alejandra González
df33aaf540 Check if dropping an expression may have indirect side-effects (#14594)
It is not enough to check if an expression type implements `Drop` to
determine whether it can have a significant side-effect.

Also, add tests for unchecked cases which were explicitly handled in the
code, such as checking for side effect in a `struct`'s fields, or in its
base expression.

Fix rust-lang/rust-clippy#14592

changelog: [`no_effect_underscore_binding`]: do not propose to remove
the assignment of an object if dropping it might indirectly have a
visible side effect
2025-05-19 11:41:40 +00:00
Stan Manilov
686f0fa8a2 Remove unused references and simplify one 2025-05-19 14:41:19 +03:00
Lukas Wirth
a1d75fb0d0 Merge pull request #19822 from Veykril/push-mzzluystvwls
minor: Remote dangling file
2025-05-19 11:20:03 +00:00
Stuart Cook
315874c077 Rollup merge of #141242 - folkertdev:aarch64-asm-parse-errors, r=Amanieu
in `tests/ui/asm/aarch64/parse-error.rs`, only test cases specific to that target

this is more in line with the x86 parse error tests at https://github.com/rust-lang/rust/blob/master/tests/ui/asm/x86_64/x86_64_parse_error.rs. We could at this point use minicore so that these tests run no matter the host target?

`tests/ui/asm/aarch64/parse-error.rs` was mostly a copy of https://github.com/rust-lang/rust/blob/master/tests/ui/asm/parse-error.rs, though a bit out of date. The only aarch64-specific tests are those that talk about register names. Here is a diff between those two files:

```diff
--- <unnamed>
+++ <unnamed>
`@@` -1,4 +1,4 `@@`
-//@ needs-asm-support
+//@ only-aarch64

 use std::arch::{asm, global_asm};

`@@` -36,36 +36,12 `@@`
         //~^ ERROR expected one of
         asm!("{}", options(), const foo);
         //~^ ERROR attempt to use a non-constant value in a constant
-
-        // test that asm!'s clobber_abi doesn't accept non-string literals
-        // see also https://github.com/rust-lang/rust/issues/112635
-        asm!("", clobber_abi());
-        //~^ ERROR at least one abi must be provided
         asm!("", clobber_abi(foo));
         //~^ ERROR expected string literal
         asm!("", clobber_abi("C" foo));
         //~^ ERROR expected one of `)` or `,`, found `foo`
         asm!("", clobber_abi("C", foo));
         //~^ ERROR expected string literal
-        asm!("", clobber_abi(1));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(()));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(uwu));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi({}));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(loop {}));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(if));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(do));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(<));
-        //~^ ERROR expected string literal
-        asm!("", clobber_abi(.));
-        //~^ ERROR expected string literal
-
         asm!("{}", clobber_abi("C"), const foo);
         //~^ ERROR attempt to use a non-constant value in a constant
         asm!("", options(), clobber_abi("C"));
`@@` -76,7 +52,15 `@@`
         //~^^ ERROR argument never used
         //~^^^ ERROR attempt to use a non-constant value in a constant
         //~^^^^ ERROR attempt to use a non-constant value in a constant
-
+        asm!("", a = in("x0") foo);
+        //~^ ERROR explicit register arguments cannot have names
+        asm!("{a}", in("x0") foo, a = const bar);
+        //~^ ERROR attempt to use a non-constant value in a constant
+        asm!("{a}", in("x0") foo, a = const bar);
+        //~^ ERROR attempt to use a non-constant value in a constant
+        asm!("{1}", in("x0") foo, const bar);
+        //~^ ERROR positional arguments cannot follow named arguments or explicit register arguments
+        //~^^ ERROR attempt to use a non-constant value in a constant
         asm!("", options(), "");
         //~^ ERROR expected one of
         asm!("{}", in(reg) foo, "{}", out(reg) foo);
`@@` -109,13 +93,11 `@@`
 global_asm!("{}", const(reg) FOO);
 //~^ ERROR expected one of
 global_asm!("", options(FOO));
-//~^ ERROR expected one of `)`, `att_syntax`, or `raw`, found `FOO`
-global_asm!("", options(FOO,));
-//~^ ERROR expected one of `)`, `att_syntax`, or `raw`, found `FOO`
+//~^ ERROR expected one of
 global_asm!("", options(nomem FOO));
-//~^ ERROR expected one of `)` or `,`, found `FOO`
+//~^ ERROR expected one of
 global_asm!("", options(nomem, FOO));
-//~^ ERROR expected one of `)`, `att_syntax`, or `raw`, found `FOO`
+//~^ ERROR expected one of
 global_asm!("{}", options(), const FOO);
 global_asm!("", clobber_abi(FOO));
 //~^ ERROR expected string literal
`@@` -129,8 +111,6 `@@`
 //~^ ERROR `clobber_abi` cannot be used with `global_asm!`
 global_asm!("{}", options(), clobber_abi("C"), const FOO);
 //~^ ERROR `clobber_abi` cannot be used with `global_asm!`
-global_asm!("", clobber_abi("C"), clobber_abi("C"));
-//~^ ERROR `clobber_abi` cannot be used with `global_asm!`
 global_asm!("{a}", a = const FOO, a = const BAR);
 //~^ ERROR duplicate argument named `a`
 //~^^ ERROR argument never used
`@@` -142,16 +122,3 `@@`
 //~^ ERROR asm template must be a string literal
 global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
 //~^ ERROR asm template must be a string literal
-
-global_asm!("{}", in(reg));
-//~^ ERROR the `in` operand cannot be used with `global_asm!`
-global_asm!("{}", out(reg));
-//~^ ERROR the `out` operand cannot be used with `global_asm!`
-global_asm!("{}", lateout(reg));
-//~^ ERROR the `lateout` operand cannot be used with `global_asm!`
-global_asm!("{}", inout(reg));
-//~^ ERROR the `inout` operand cannot be used with `global_asm!`
-global_asm!("{}", inlateout(reg));
-//~^ ERROR the `inlateout` operand cannot be used with `global_asm!`
-global_asm!("{}", label(reg));
-//~^ ERROR the `label` operand cannot be used with `global_asm!`
```
2025-05-19 21:10:44 +10:00
Stuart Cook
b86de538ce Rollup merge of #141239 - RalfJung:dladdr-fname, r=Noratrieb
dladdr cannot leave dli_fname to be null

There are two places in the repo calling `dladdr`, and they are inconsistent wrt their assumption of whether the `dli_fname` field can be null. Let's make them consistent. I see nothing in the docs that allows it to be null, but just to be on the safe side let's make this an assertion so hopefully we get a report if that ever happens.
2025-05-19 21:10:44 +10:00
Stuart Cook
1d5c35a52d Rollup merge of #141225 - matthiaskrgr:crashes_may2015, r=compiler-errors
more ice tests

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: test-various
2025-05-19 21:10:44 +10:00
Stuart Cook
5d7e580350 Rollup merge of #141117 - klensy:opt-dist-icf, r=Kobzol
opt-dist: fix deprecated BOLT -icf=1 option

Replaced deprecated `-icf=1` BOLT option.

Spotted in recent CI run (https://github.com/rust-lang-ci/rust/actions/runs/15080898417/job/42397253162):
```
BOLT-WARNING: specifying numeric value "1" for option -icf is deprecated
```

Change was added in https://github.com/llvm/llvm-project/pull/116275

Btw, now there also exist new option `-icf=safe`, will be nice to try it too.
2025-05-19 21:10:43 +10:00
Stuart Cook
3b22c21dd8 Rollup merge of #140847 - Zalathar:unused-local-file, r=SparrowLii
coverage: Detect unused local file IDs to avoid an LLVM assertion

Each function's coverage metadata contains a *local file table* that maps local file IDs (used by the function's mapping regions) to global file IDs (shared by all functions in the same CGU).

LLVM requires all local file IDs to have at least one mapping region, and has an assertion that will fail if it detects a local file ID with no regions. To make sure that assertion doesn't fire, we need to detect and skip functions whose metadata would trigger it.

(This can't actually happen yet, because currently all of a function's spans must belong to the same file and expansion. But this will be an important edge case when adding expansion region support.)
2025-05-19 21:10:42 +10:00
Lukas Wirth
9f82458c25 Remote dangling file 2025-05-19 13:08:29 +02:00
nora
85379b1d1a Merge pull request #2389 from fuzzypixelz/typos
Fix typos in "Libraries and Metadata"
2025-05-19 12:39:24 +02:00
Lukas Wirth
84ed11b92f Merge pull request #19809 from flodiebold/push-txyotwlvvkln
internal: Catch panics in inference in analysis-stats
2025-05-19 10:12:31 +00:00
bors
7068c8bd81 Auto merge of #140754 - dpaoliello:cygwinpath, r=marcoieni
[win][CI] Convert paths to Windows format before adding to PATH

While trying to get the `aarch64-msvc` build working correctly (#140136), I noticed that the `PATH` observed during the Rust steps of the build on Windows builds had some entries still in MinGW format, which means that Windows would not be able to use them correctly:

From <https://github.com/rust-lang/rust/actions/runs/14606167901/job/40975555680#step:28:192> note the path for `ninja` and `sccache`.

```
PATH = Some(C:\a\rust\rust\src\ci\citool\../../../build/citool\debug\deps;C:\a\rust\rust\src\ci\citool\../../../build/citool\debug;C:\Users\runneradmin\.rustup\toolchains\stable-aarch64-pc-windows-msvc\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Program Files\Git\clangarm64/bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;/c/a/rust/rust/ninja;/c/a/rust/rust/sccache;C:\Users\runneradmin/.cargo/bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files (x86)\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver\;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\arm64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.442-6\x64\bin;C:\Program Files (x86)\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps)
```
The fix for this is to use `cygpath` to convert from the Cygwin format back to native Windows format before adding to the `PATH`.

---
try-job: dist-aarch64-msvc
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: i686-msvc-1
try-job: i686-msvc-2
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
try-job: dist-i686-mingw
2025-05-19 09:51:31 +00:00
Folkert de Vries
85f9dce889 in aarch64 asm parse error tests, only test cases specific to that target
this is more in line with the x86 parse error tests. The cross-platform tests were more complete anyway
2025-05-19 11:11:55 +02:00
Ralf Jung
44d3c93fc8 Merge pull request #4329 from RalfJung/no-casts
enable clippy::as_conversions to fully rule out as-casts
2025-05-19 09:02:56 +00:00
Ralf Jung
446fa22412 add to_u64() helper method and use it where appropriate 2025-05-19 10:08:48 +02:00
Ralf Jung
0ba2a3a818 enable clippy::as_conversions to fully rule out as-casts 2025-05-19 10:08:46 +02:00
Samuel Tardieu
d44e35d595 Docs: Use spaces in good first issue label (#14844)
This unifies the Clippy repo with the rest of the rust org repos.

changelog: none
2025-05-19 07:55:42 +00:00
Philipp Krones
7123f2acf7 Docs: Use spaces in good first issue label
This unifies the Clippy repo with the rest of the rust org repos.
2025-05-19 09:37:47 +02:00
Lukas Wirth
d6859ad411 Merge pull request #19814 from Veykril/lw-sxquntxksovs
Debounce workspace fetching for workspace structure changes
2025-05-19 07:06:10 +00:00
Lukas Wirth
e493cb1ad2 Debounce workspace fetching for workspace structure changes 2025-05-19 08:55:38 +02:00
Lukas Wirth
687eeeafc8 Change import prefix default to be by crate
The current default plain, tends to create non-uniform import blocks over time, some being relative, some being absolute.
I believe we should encourage a different default here.
2025-05-19 08:44:05 +02:00
Ralf Jung
d22f53b970 dladdr cannot leave dli_fname to be null 2025-05-19 08:27:54 +02:00
Ralf Jung
d5240ccd1c Merge pull request #4331 from rust-lang/rustup-2025-05-19
Automatic Rustup
2025-05-19 06:25:41 +00:00
Lukas Wirth
0e63f085d3 Merge pull request #19757 from Veykril/push-zzxwtzuzqvzx
perf: Request cancellation while processing changed files
2025-05-19 06:20:31 +00:00
bors
5f292eea6d Auto merge of #141238 - Zalathar:rollup-zdqpazo, r=Zalathar
Rollup of 4 pull requests

Successful merges:

 - #140049 (fix autodiff macro on generic functions)
 - #140874 (make `rustc_attr_parsing` less dominant in the rustc crate graph)
 - #141094 (add regression test for rust-lang#101650)
 - #141110 ([std] fix the presentation of `split_off_mut` and `split_off` documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-19 05:40:16 +00:00
The Miri Cronjob Bot
1bb2d7352a Merge from rustc 2025-05-19 05:02:00 +00:00