Commit graph

308340 commits

Author SHA1 Message Date
Jubilee
23d1cc7c52
Rollup merge of #147332 - Shunpoco:fast-spellcheck, r=Kobzol
Set opt-level flag for installing tool only on CI

## Context
ensure_version_or_cargo_install uses -Copt-level=0 for quicker installation. However, the flag affects the tool's performance. For example, typos-cli with opt-level=0 takes 15 seconds for checking /compiler on my local, but the tool with default opt-level only takes less than 1 sec.

It fixes rust-lang/rust#147331

## Changes
This PR enables the option only when the test tidy is run on CI.
We've discussed that opt-level=1 should be enough, so I also change the level from 0 to 1.
2025-10-05 11:59:23 -07:00
Jubilee
d8fc465bbb
Rollup merge of #147327 - Zalathar:inherent, r=workingjubilee
cg_llvm: Remove inherent methods from several LLVM FFI types

This is mainly motivated by rust-lang/rust#142897, which proposes to move the LLVM FFI bindings out of `rustc_codegen_llvm` and into `rustc_llvm`, which is arguably the more correct place for them from a linking perspective.

---

In order to perform that migration, all of the types used in FFI signatures also need to be moved. However, several of those types have inherent methods that convert from backend-independent types to LLVM FFI types.

Moving the inherent methods as-is would require adding a lot of otherwise-unnecessary dependencies to `rustc_llvm`. And we can't leave them behind as-is, because inherent methods can't be defined in another crate.

Therefore, this PR replaces several of those inherent methods with either extension trait methods or free functions.
2025-10-05 11:59:23 -07:00
Chayim Refael Friedman
c7a6a799f0 Add regression test for need-mut diagnostic 2025-10-05 21:57:22 +03:00
Alice Ryhl
76dcb39c24 Adjust error messages 2025-10-05 17:45:27 +00:00
Alice Ryhl
f65250b3dd Document workaround in docs 2025-10-05 17:45:27 +00:00
Alice Ryhl
cd44cd0f63 Improve docs for module 2025-10-05 17:45:27 +00:00
Alice Ryhl
7e1c00dbce Prevent downstream impl DerefMut for Pin<LocalType> 2025-10-05 17:45:24 +00:00
Josh Triplett
2997070be1 unused_must_use: Factor out a variable for the parent module DefId
This simplifies the initial conditional, and will allow reusing the
variable in subsequent checks.
2025-10-05 10:23:44 -07:00
Shunpoco
8a31837054 Set opt-level for installing tool only on CI
ensure_version_or_cargo_install uses -Copt-level=0 for quicker installation.
However, the flag affects the tool's performance. For example, typos-cli with opt-level=0 takes 15 seconds for checking ./compiler, but the tool with default opt-level only takes less than 1 sec.
This commit enables the option only when the test tidy is run on CI.
2025-10-05 16:57:51 +01:00
bors
981353ca16 Auto merge of #147345 - Kivooeo:tidy-flt-fix, r=Kobzol
Tidy: revert `flt` to `ftl`

As was explained here https://github.com/rust-lang/rust/pull/147191#issuecomment-3353801210, this reverting this change because `flt` is incorrect format

Also maybe there is existed PR for that? I didn't found one

Follow up https://github.com/rust-lang/rust/pull/147191

cc `@GuillaumeGomez`
2025-10-05 15:55:18 +00:00
Alex Macleod
2a9eb78c0e
redundant_pattern_match: clean-up (#15796)
- cast `&[Arm]` to `&[Arm; 2]` early on to hopefully avoid bounds checks
- use `if let [pattern] = X { .. }` instead of `if let patterns = X {
let pattern = patterns[0]; .. }`
- use `Symbol`s instead of `&str`s
- reduce indentation

Diff best viewed with whitespace ignored

changelog: none
2025-10-05 15:09:10 +00:00
Chayim Refael Friedman
a958b84ea4 Fix merging of import granularity setting with the granularity we infer
Previously it was wrong for some combinations.
2025-10-05 17:47:11 +03:00
Ralf Jung
de97b43432
Merge pull request #4617 from RalfJung/warn-dedup
deduplicate warnings globally
2025-10-05 14:19:14 +00:00
Ralf Jung
f28b8d4f15 deduplicate warnings globally 2025-10-05 15:53:07 +02:00
bors
bcbbdcb852 Auto merge of #147371 - Zalathar:rollup-897uitw, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144908 (Fix doctest output json)
 - rust-lang/rust#147262 (Make #[link="dl"] an FCW rather than an error)
 - rust-lang/rust#147364 (update autodiff testcases)
 - rust-lang/rust#147367 (Trivial code cleanup in resolve)
 - rust-lang/rust#147369 (Fill out AVR target metadata)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 12:43:00 +00:00
Jieyou Xu
a8b9a57674
bootstrap: relax compiler-rt root assertion
Not needed during tests.
2025-10-05 20:30:52 +08:00
Karol Zwolak
5234d36597 add test 2025-10-05 14:27:31 +02:00
Chayim Refael Friedman
c13b87752a Deprecate preserve import granularity option
It didn't do anything (behaved like `item`), as with `enforceGranularity = false` (which is the default), the style of the current file is always preferred, regardless of the setting.

We could make it fail when the setting is `preserve` and the current file's style could not be detected, but that makes little sense.

It is a bit weird that the default is `crate` but `preserve` falls back to `item`, however that was the previous behavior.
2025-10-05 15:19:52 +03:00
Jieyou Xu
7ed476f51f
bootstrap: don't build redirect pages during dry-run/test 2025-10-05 20:18:38 +08:00
Folkert de Vries
5a0ea3bfba
power align: ignore repr(C) unions and enums 2025-10-05 14:18:17 +02:00
Folkert de Vries
87e8ec8114
power align: format test file 2025-10-05 14:15:40 +02:00
Karol Zwolak
a316f5b72e don't make empty ident when printing ' ident from extern "'" 2025-10-05 14:08:42 +02:00
cyrgani
0bc6945186
give a better example why std modules named like primitives are needed 2025-10-05 13:58:11 +02:00
Chayim Refael Friedman
6fa86b7a88
Merge pull request #20799 from senekor/senekor/tpoptnlrxzyy
docs: Mention editor-independent configuration
2025-10-05 11:51:30 +00:00
Remo Senekowitsch
a4d51da309
docs: Mention editor-independent configuration 2025-10-05 13:41:28 +02:00
Stuart Cook
21b5d6bd86
Rollup merge of #147369 - Noratrieb:avr-metadata, r=jieyouxu
Fill out AVR target metadata

This will make `-Zbuild-std` automatically build the right crates, notably not building `std` by default, which will both be useful for users and also fix the build for https://does-it-build.noratrieb.dev, which currently tries to build std: http://localhost:3000/build?nightly=2025-07-12&target=avr-none&mode=std.

cc `@Patryk27` but I don't think this necessarily needs your approval
2025-10-05 22:15:08 +11:00
Stuart Cook
94e04993a1
Rollup merge of #147367 - chenyukang:yukang-trivial-cleanup, r=jieyouxu
Trivial code cleanup in resolve

r? `@jieyouxu`
2025-10-05 22:15:07 +11:00
Stuart Cook
c8407194f9
Rollup merge of #147364 - ZuseZ4:update-autodiff-tests, r=jieyouxu
update autodiff testcases

unblock https://github.com/EnzymeAD/Enzyme/pull/2430 (again).
Just as I landed a fix for the last test, this one broke. The test should now be fine if the name mangling hash changes again.

Also removed an outdated fixme that's not needed since moving autodiff to an intrinsic. The test currently just checks that it compiles, I'll add more precise checks once we actually run this in CI.

r? compiler
2025-10-05 22:15:06 +11:00
Stuart Cook
d97e346ac7
Rollup merge of #147262 - JonathanBrouwer:fix-link, r=jieyouxu
Make #[link="dl"] an FCW rather than an error

Fixes https://github.com/rust-lang/rust/issues/147254
I forgot to implement the T-lang decision in https://github.com/rust-lang/rust/pull/143193#issuecomment-3138479942, this implements that decision

r? ``@jdonszelmann``
Can be reviewed commit-by-commit
This needs a beta backport
2025-10-05 22:15:06 +11:00
Stuart Cook
cc1a80629f
Rollup merge of #144908 - GuillaumeGomez:fix-doctest-output-json, r=fmease
Fix doctest output json

Fixes rust-lang/rust#144798.

Hopefully it will work with the new changes in `libtest` without needing to do both at once.

This PR moves the `rustdoc` merged doctest extra information directly into `libtest` to ensure they share the same rendering to prevent the bug uncovered in rust-lang/rust#144798.

cc `@lolbinary` (as you reviewed the first PR)

And since we're making changes to `libtest`:

r? `@Amanieu`
2025-10-05 22:15:05 +11:00
nora
9ccaf080cb
Fill out AVR target metadata
This will make `-Zbuild-std` automatically build the right crates, notably not building `std` by default, which will both be useful for users and also fix the build for https://does-it-build.noratrieb.dev.
2025-10-05 12:01:23 +02:00
yukang
95445f9b96 Trivial code cleanup in resolve 2025-10-05 17:27:45 +08:00
Guillaume Gomez
99c7959bb7 Add regression test for rustdoc output format 2025-10-05 11:13:05 +02:00
Chayim Refael Friedman
d1ab4e63dd
Merge pull request #20797 from A4-Tacks/fixed-fixme-tuple-field-infer
minor: Remove FIXME for test_tuple_field_inference
2025-10-05 07:49:48 +00:00
A4-Tacks
22c1eb85f8
minor: Remove FIXME for test_tuple_field_inference
This seems to have been fixed
2025-10-05 15:35:30 +08:00
Manuel Drehwald
7c8fe29fd6 solve autodiffv2.rs FIXME and make identical_fnc test more robust 2025-10-05 03:07:51 -04:00
Chayim Refael Friedman
41dd2b69a6 Switch to home-made db attaching infrastructure
Instead of using Salsa's, as we can no longer can a `dyn HirDatabase` from the `dyn salsa::Database` Salsa provides.
2025-10-05 09:55:50 +03:00
Chayim Refael Friedman
995ba5f3b7
Merge pull request #20795 from A4-Tacks/parse-edition-extract-expr-format-str
minor: Fix CURRENT_FIXME for extract_expressions_from_format_string
2025-10-05 06:53:17 +00:00
Chayim Refael Friedman
fcf7795d58
Merge pull request #20793 from A4-Tacks/diag-paren-missing-unsafe
Fix missing parentheses for missing_unsafe
2025-10-05 06:52:31 +00:00
A4-Tacks
c7ed41ebd0
Fix parentheses for missing_unsafe
I seem unable to use `Expr::needs_parens*` to complete it

Example
---
```rust
static mut STATIC_MUT: u8 = 0;

fn foo() -> u8 {
    STATIC_MUT$0 * 2
}
```

**Before this PR**:

```rust
static mut STATIC_MUT: u8 = 0;

fn foo() -> u8 {
    unsafe { STATIC_MUT } * 2
}
```

**After this PR**:

```rust
static mut STATIC_MUT: u8 = 0;

fn foo() -> u8 {
    (unsafe { STATIC_MUT }) * 2
}
```
2025-10-05 14:02:49 +08:00
A4-Tacks
b74760a664
minor: Fix CURRENT_FIXME for extract_expressions_from_format_string 2025-10-05 13:54:07 +08:00
Manuel Drehwald
bd975777a2
Merge pull request #2603 from rust-lang/autodiff-updates
update libEnzyme file name, and add missing strict-aliasing flag
2025-10-05 01:40:12 -04:00
Manuel Drehwald
765e2fe6ee Add potential instability warning 2025-10-05 01:38:29 -04:00
Jack Huey
8b178272c7 Remove unneeded get_hidden_type 2025-10-05 00:50:19 -04:00
bors
e2c96cc06b Auto merge of #147363 - Zalathar:rollup-d9kd06g, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting)
 - rust-lang/rust#147309 (Add documentation about unwinding to wasm targets)
 - rust-lang/rust#147310 (Mark `PatternTypo` suggestion as maybe incorrect)
 - rust-lang/rust#147320 (Avoid to suggest pattern match on the similarly named in fn signature)
 - rust-lang/rust#147328 (Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`)
 - rust-lang/rust#147337 (Make `fmt::Write` a diagnostic item)
 - rust-lang/rust#147349 (Improve the advice given by panic_immediate_abort)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 04:36:49 +00:00
Stuart Cook
a0a4905723
Rollup merge of #147349 - saethlin:panic-immediate-advice, r=Noratrieb
Improve the advice given by panic_immediate_abort

Now that https://github.com/rust-lang/rust/pull/147338 is merged, users should consider using the Cargo support for immediate-aborting panics.
2025-10-05 15:35:05 +11:00
Stuart Cook
80759350c7
Rollup merge of #147337 - ada4a:write-diag-item, r=fmease
Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
2025-10-05 15:35:04 +11:00
Stuart Cook
56c96aebfc
Rollup merge of #147328 - EFanZh:lock-with, r=joboet
Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`

ACP: https://github.com/rust-lang/libs-team/issues/497.
2025-10-05 15:35:04 +11:00
Stuart Cook
cae84c695a
Rollup merge of #147320 - chenyukang:yukang-fix-147303-fn-arg, r=jieyouxu
Avoid to suggest pattern match on the similarly named in fn signature

Fixes rust-lang/rust#147303
2025-10-05 15:35:03 +11:00
Stuart Cook
620ffe6595
Rollup merge of #147310 - Jules-Bertholet:maybe-incorrect-pattern-typo, r=chenyukang
Mark `PatternTypo` suggestion as maybe incorrect

Partial fix for https://github.com/rust-lang/rust/issues/147303.

`@rustbot` label A-diagnostics A-suggestion-diagnostics D-invalid-suggestion
2025-10-05 15:35:03 +11:00