283028 Commits

Author SHA1 Message Date
06cf265cec
mikros: Add a platform spcific method to control stdout/err printing to serial as a fallback 2025-03-04 08:58:28 -06:00
a52a2f1ee7
Format 2025-03-04 08:30:27 -06:00
437085182c
Update to lastest rustc 2025-03-02 10:44:44 -06:00
bors
7c4a55c2ac Auto merge of #137425 - yotamofek:pr/rustdoc/return-impl-display-redux, r=GuillaumeGomez
`librustdoc`: return `impl fmt::Display` in more places instead of writing to strings

Continuation of #136784 , another attempt at landing the larger parts of #136748 .
I'd like to, gradually, make all of the building blocks for rendering docs in `librustdoc` return `impl fmt::Display` instead of returning `Strings`, or receiving a `&mut String` (or `&mut impl fmt::Write`). Another smaller end goal is to be able to get rid of [`write_str`](8dac72bb1d/src/librustdoc/html/format.rs (L40-L42)).
This PR is a large step in that direction.

Most of the changes are quite mechanical, and split up into separate commits for easier reviewing (hopefully). I took `print_item` and then started by converting all the functions it called (and their dependencies), and the last commit does the conversion for `print_item` itself. Ignoring whitespace should make reviewing a bit easier.

And most importantly, perf run shows pretty good results locally, hopefully CI will also show green 😁

r? `@GuillaumeGomez` , if you feel like it.
2025-03-02 12:35:48 +00:00
bors
4b696e6bf7 Auto merge of #136864 - Kobzol:citool, r=marcoieni
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: https://github.com/rust-lang/rust/issues/137013
2025-03-02 09:18:02 +00:00
bors
1c3b035542 Auto merge of #137855 - matthiaskrgr:rollup-uh7f3fi, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #137804 (rename BackendRepr::Vector → SimdVector)
 - #137807 (Fully qualify `Result` in generated doctest code)
 - #137809 (Use correct error message casing for `io::const_error`s)
 - #137818 (tests: adapt for LLVM 21 changes)
 - #137822 (Update query normalizer docs to not position it as the greatest pioneer in the space of normalization)
 - #137824 (Tweak invalid RTN errors)
 - #137828 (Fix inaccurate `std::intrinsics::simd` documentation)
 - #137830 (Fix link failure on AVR (incompatible ISA error))
 - #137837 (Update `const_conditions` and `explicit_implied_const_bounds` docs)
 - #137840 (triagebot: only ping me for constck)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-02 01:39:49 +00:00
bors
351686bcfd Auto merge of #137752 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

? `@Manishearth`

Cargo.lock change because of Clippy version bump and rustc_tool_utils new release.

Fixes #137640

Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.
2025-03-01 22:22:06 +00:00
Matthias Krüger
5bdde89544
Rollup merge of #137840 - fee1-dead-contrib:push-uwkzouvnrnvs, r=oli-obk
triagebot: only ping me for constck

Per the [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/rustbot.20pings).

cc `@rust-lang/wg-const-eval.`
2025-03-01 16:03:21 +01:00
Matthias Krüger
935535d14f
Rollup merge of #137837 - fee1-dead-contrib:push-pvqvwuvrnwsy, r=compiler-errors
Update `const_conditions` and `explicit_implied_const_bounds` docs

Move documentation to query definitions, and add docs to `explicit_implied_const_bounds`.

r? project-const-traits
2025-03-01 16:03:20 +01:00
Matthias Krüger
878f383118
Rollup merge of #137830 - LuigiPiucco:incompatible-isa-fix, r=workingjubilee
Fix link failure on AVR (incompatible ISA error)

Fixes #137739. A reproducer of the issue is present there. I believe the root cause was introducing the avr-none target (which has no CPU by default) while also trying to get the ISA revision from the target spec. This commit uses the `target-cpu` option instead, which is already required to be present for the target.

r? compiler
cc ``@Patryk27``
2025-03-01 16:03:20 +01:00
Matthias Krüger
c112b70f12
Rollup merge of #137828 - folkertdev:simd-intrinsic-doc-fixes, r=workingjubilee
Fix inaccurate `std::intrinsics::simd` documentation

This addresses two issues:

- the docs on comparison operators (`simd_gt` etc.) said they only work for floating-point vectors, but they work for integer vectors too.
- the docs on various functions that use a mask did not document that the mask must be a signed integer vector. Unsigned integer vectors would cause invalid behavior when the mask vector is widened (unsigned integers would use zero extension, producing incorrect results).

r? ``@workingjubilee``
2025-03-01 16:03:19 +01:00
Matthias Krüger
a500a43367
Rollup merge of #137824 - estebank:rtn-sugg, r=compiler-errors
Tweak invalid RTN errors

Make suggestions verbose.

When encountering `method(type)` bound, suggest `method(..)` instead of `method()`.

```
error: argument types not allowed with return type notation
  --> $DIR/bad-inputs-and-output.rs:9:23
   |
LL | fn foo<T: Trait<method(i32): Send>>() {}
   |                       ^^^^^
   |
help: remove the input types
   |
LL - fn foo<T: Trait<method(i32): Send>>() {}
LL + fn foo<T: Trait<method(..): Send>>() {}
   |
```

When encountering both return type and arg list that isn't `..`, suggest replacing both.

```
error: return type not allowed with return type notation
  --> $DIR/bad-inputs-and-output.rs:12:25
   |
LL | fn bar<T: Trait<method() -> (): Send>>() {}
   |                         ^^^^^^
   |
help: use the right argument notation and remove the return type
   |
LL - fn bar<T: Trait<method() -> (): Send>>() {}
LL + fn bar<T: Trait<method(..): Send>>() {}
   |
```

When encountering a return type, suggest removing it including the leading whitespace.

```
error: return type not allowed with return type notation
  --> $DIR/bad-inputs-and-output.rs:24:45
   |
LL | fn bay_path<T: Trait>() where T::method(..) -> (): Send {}
   |                                             ^^^^^
   |
help: remove the return type
   |
LL - fn bay_path<T: Trait>() where T::method(..) -> (): Send {}
LL + fn bay_path<T: Trait>() where T::method(..): Send {}
   |
```

r? ``@compiler-errors``
2025-03-01 16:03:18 +01:00
Matthias Krüger
88e75470a3
Rollup merge of #137822 - BoxyUwU:query_normalizer_docs, r=compiler-errors
Update query normalizer docs to not position it as the greatest pioneer in the space of normalization

I don't think its true that we intend to replace all normalization with the query normalizer- its more likely that once the new solver is stable we can replace the query normalizer with normal normalization calls as the new solver caches much more than the old solver

r? ``@compiler-errors``
2025-03-01 16:03:17 +01:00
Matthias Krüger
224ea37aa3
Rollup merge of #137818 - durin42:llvm-21-remove-readonly, r=jieyouxu
tests: adapt for LLVM 21 changes

Per discussion in #137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21.

Fixes #137799.
2025-03-01 16:03:15 +01:00
Matthias Krüger
bc89ab19c3
Rollup merge of #137809 - Noratrieb:io-error-casing, r=thomcc
Use correct error message casing for `io::const_error`s

Error messages are supposed to start with lowercase letters, but a lot of `io::const_error` messages did not. This fixes them to start with a lowercase letter.
I did consider adding a const check for this to the macro, but some of them start with proper nouns that make sense to uppercase them.

See https://doc.rust-lang.org/1.85.0/std/error/trait.Error.html
2025-03-01 16:03:13 +01:00
Matthias Krüger
643c19c160
Rollup merge of #137807 - GuillaumeGomez:doctest-qualify-result, r=notriddle
Fully qualify `Result` in generated doctest code

As discussed in https://lore.kernel.org/rust-for-linux/20250228132553.880126-1-guillaume1.gomez@gmail.com/T/#u, it would require less code for RfL to be able to reach the same result (pun unintended).

cc ``@ojeda``

r? ``@notriddle``
2025-03-01 16:03:12 +01:00
Matthias Krüger
3bf976542a
Rollup merge of #137804 - RalfJung:backend-repr-simd-vector, r=workingjubilee
rename BackendRepr::Vector → SimdVector

For many Rustaceans, "vector" does not imply "SIMD", so let's be more clear in this type that is used pervasively in the compiler.

r? `@workingjubilee`
2025-03-01 16:03:10 +01:00
bors
8c392966a0 Auto merge of #137848 - matthiaskrgr:rollup-vxtrkis, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #136503 (Tweak output of const panic diagnostic)
 - #137390 (tests: fix up new test for nocapture -> capture(none) change)
 - #137617 (Introduce `feature(generic_const_parameter_types)`)
 - #137719 (Add missing case explanation for doc inlined re-export of doc hidden item)
 - #137763 (Use `mk_ty_from_kind` a bit less, clean up lifetime handling in borrowck)
 - #137769 (Do not yeet `unsafe<>` from type when formatting unsafe binder)
 - #137776 (Some `rustc_transmute` cleanups)
 - #137800 (Remove `ParamEnv::without_caller_bounds`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-01 11:43:19 +00:00
Matthias Krüger
c03756a56b
Rollup merge of #137800 - BoxyUwU:param_env_docs, r=compiler-errors
Remove `ParamEnv::without_caller_bounds`

This doesn't really do anything that `ParamEnv::empty` doesn't do nowadays as `ParamEnv` *only* stores caller bounds since other information has been moved out into `TypingMode`

r? ```@compiler-errors``` ```@lcnr```
2025-03-01 11:34:02 +01:00
Matthias Krüger
b6c1b635f7
Rollup merge of #137776 - nnethercote:rustc_transmute-cleanups, r=jswrenn
Some `rustc_transmute` cleanups

A number of small things that can be removed.

r? ``@jswrenn``
2025-03-01 11:34:01 +01:00
Matthias Krüger
b7853ef3cf
Rollup merge of #137769 - compiler-errors:empty-unsafe-fmt, r=ytmimi
Do not yeet `unsafe<>` from type when formatting unsafe binder

Unsafe binders are types like `unsafe<'a, 'b> Ty<'a, 'b>`. However, users can also specify unsafe binder types with no bound vars, like `unsafe<> Ty`.

When I added nightly formatting for unsafe binders, I didn't consider this, so on nightly we are stripping the `unsafe<>` part, which gives us back `Ty` which is a different type!

This PR fixes that.

r? ``@ytmimi``
2025-03-01 11:34:00 +01:00
Matthias Krüger
1d9992d4d2
Rollup merge of #137763 - compiler-errors:ty-nits, r=BoxyUwU
Use `mk_ty_from_kind` a bit less, clean up lifetime handling in borrowck

r? ``@BoxyUwU``

Pulled out of my attempt to turn that `*const dyn Tr + '_` casting into a lint (which failed lmao)
2025-03-01 11:34:00 +01:00
Matthias Krüger
db12f00627
Rollup merge of #137719 - GuillaumeGomez:missing-doc, r=notriddle
Add missing case explanation for doc inlined re-export of doc hidden item

This case was not covered in the rustdoc book as uncovered in #137342.

r? ``@notriddle``
2025-03-01 11:33:59 +01:00
Matthias Krüger
415b207b7f
Rollup merge of #137617 - BoxyUwU:generic_const_parameter_types, r=lcnr
Introduce `feature(generic_const_parameter_types)`

Allows to define const generic parameters whose type depends on other generic parameters, e.g. `Foo<const N: usize, const ARR: [u8; N]>;`

Wasn't going to implement for this for a while until we could implement it with `bad_inference.rs` resolved but apparently the project simd folks would like to be able to use this for some intrinsics and the inference issue isn't really a huge problem there aiui. (cc ``@workingjubilee`` )
2025-03-01 11:33:58 +01:00
Matthias Krüger
11ddd56b31
Rollup merge of #137390 - durin42:llvm-21-nocapture-rename, r=nikic
tests: fix up new test for nocapture -> capture(none) change

Same change as #136287, but for a newly introduced test.

``@rustbot`` label llvm-main
r? ``@nikic``
2025-03-01 11:33:58 +01:00
Matthias Krüger
f012947bf0
Rollup merge of #136503 - estebank:const-panic, r=RalfJung
Tweak output of const panic diagnostic

### Shorten span of panic failures in const context

Previously, we included a redundant prefix on the panic message and a postfix of the location of the panic. The prefix didn't carry any additional information beyond "something failed", and the location of the panic is redundant with the diagnostic's span, which gets printed out even if its code is not shown.

```
error[E0080]: evaluation of constant value failed
--> $DIR/assert-type-intrinsics.rs:11:9
   |
LL |         MaybeUninit::<!>::uninit().assume_init();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: aborted execution: attempted to instantiate uninhabited type `!`
```

```
error[E0080]: evaluation of `Fail::<i32>::C` failed
--> $DIR/collect-in-dead-closure.rs:9:19
   |
LL |     const C: () = panic!();
   |                   ^^^^^^^^ explicit panic
   |
   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
```
```
error[E0080]: evaluation of constant value failed
--> $DIR/uninhabited.rs:87:9
   |
LL |         assert!(false);
   |         ^^^^^^^^^^^^^^ assertion failed: false
   |
   = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
```

### Remove duplicated span from const eval frame list

When the primary span for a const error is the same as the first frame in the const error report, skip it.

```
error[E0080]: evaluation of constant value failed
  --> $DIR/issue-88434-removal-index-should-be-less.rs:3:24
   |
LL | const _CONST: &[u8] = &f(&[], |_| {});
   |                        ^^^^^^^^^^^^^^ explicit panic
   |
note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>`
  --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
   |
LL |     panic!()
   |     ^^^^^^^^ the failure occurred here
   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
```
instead of
```
error[E0080]: evaluation of constant value failed
--> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
   |
LL |     panic!()
   |     ^^^^^^^^ explicit panic
   |
note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>`
--> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
   |
LL |     panic!()
   |     ^^^^^^^^
note: inside `_CONST`
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:24
   |
LL | const _CONST: &[u8] = &f(&[], |_| {});
   |                        ^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant encountered
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:23
   |
LL | const _CONST: &[u8] = &f(&[], |_| {});
   |                       ^^^^^^^^^^^^^^^
```

r? ``@oli-obk``
2025-03-01 11:33:57 +01:00
bors
0c72c0d11a Auto merge of #133250 - DianQK:embed-bitcode-pgo, r=nikic
The embedded bitcode should always be prepared for LTO/ThinLTO

Fixes #115344. Fixes #117220.

There are currently two methods for generating bitcode that used for LTO. One method involves using `-C linker-plugin-lto` to emit object files as bitcode, which is the typical setting used by cargo. The other method is through `-C embed-bitcode=yes`.

When using with `-C embed-bitcode=yes -C lto=no`, we run a complete non-LTO LLVM pipeline to obtain bitcode, then the bitcode is used for LTO. We run the Call Graph Profile Pass twice on the same module.

This PR is doing something similar to LLVM's `buildFatLTODefaultPipeline`, obtaining the bitcode for embedding after running `buildThinLTOPreLinkDefaultPipeline`.

r? nikic
2025-03-01 08:22:18 +00:00
bors
002da76821 Auto merge of #137838 - matthiaskrgr:rollup-5brlcyr, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #137045 (Defer repeat expr `Copy` checks to end of type checking)
 - #137171 (Suggest swapping equality on E0277)
 - #137686 (Handle asm const similar to inline const)
 - #137689 (Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.)
 - #137718 (Use original command for showing sccache stats)
 - #137730 (checked_ilog tests: deal with a bit of float imprecision)
 - #137735 (Update E0133 docs for 2024 edition)
 - #137742 (unconditionally lower match arm even if it's unneeded for never pattern in match)
 - #137771 (Tweak incorrect ABI suggestion and make suggestion verbose)

Failed merges:

 - #137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-01 05:03:30 +00:00
Deadbeef
2f4b9ddf89 Update const_conditions and explicit_implied_const_bounds docs
Move documentation to query definitions, and add docs to
`explicit_implied_const_bounds`.
2025-03-01 12:58:14 +08:00
Deadbeef
340a24910f triagebot: only ping me for constck
Per the [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/rustbot.20pings).
2025-03-01 12:53:46 +08:00
Matthias Krüger
e5a639dbd0
Rollup merge of #137771 - estebank:abi-sugg, r=compiler-errors
Tweak incorrect ABI suggestion and make suggestion verbose

Provide a better suggestion message, and make the suggestion verbose.

```
error[E0703]: invalid ABI: found `riscv-interrupt`
  --> $DIR/riscv-discoverability-guidance.rs:17:8
   |
LL | extern "riscv-interrupt" fn isr() {}
   |        ^^^^^^^^^^^^^^^^^ invalid ABI
   |
   = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
help: there's a similarly named valid ABI `riscv-interrupt-m`
   |
LL | extern "riscv-interrupt-m" fn isr() {}
   |                        ++
```
2025-03-01 05:49:56 +01:00
Matthias Krüger
472bc0ee25
Rollup merge of #137742 - mu001999-contrib:fix-137708, r=compiler-errors
unconditionally lower match arm even if it's unneeded for never pattern in match

fixes #137708

Lowering arm body is skipped when lowering match arm with never pattern, but we may need the HirId for DefId in the body in later passes. And then we got the ICE `No HirId for DefId`.

Fixes this by lowering the arm body even if it's unneeded for never pattern in match, so that we can generate HirId and use it then.

r? `@compiler-errors`
2025-03-01 05:49:56 +01:00
Matthias Krüger
ecfb7d2811
Rollup merge of #137735 - ehuss:e0133-edition-docs, r=compiler-errors
Update E0133 docs for 2024 edition

The behavior of unsafe_op_in_unsafe_fn was changed in the 2024 edition. This updates this note in the E0133 docs to reflect that change.
2025-03-01 05:49:55 +01:00
Matthias Krüger
c1b4454275
Rollup merge of #137730 - RalfJung:checked_ilog_tests, r=tgross35
checked_ilog tests: deal with a bit of float imprecision

Fixes https://github.com/rust-lang/rust/issues/137591

r? `@tgross35`
2025-03-01 05:49:54 +01:00
Matthias Krüger
09492fa6db
Rollup merge of #137718 - Kobzol:sccache-stats, r=marcoieni
Use original command for showing sccache stats

I used the newer advanced command after bumping Linux sccache to 0.9. However, Windows and macOS still use older sccache, so the command didn't work for them (the error was masked on CI though). It sucks that we don't see the Windows/macOS sccache stats, so until we update both of them, just use the older flag with slightly less information.
2025-03-01 05:49:53 +01:00
Matthias Krüger
3cd89f2718
Rollup merge of #137689 - compiler-errors:coroutine, r=lcnr
Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc.

It's more conceptually justified IMO, especially when binders get implications.

r? lcnr
2025-03-01 05:49:53 +01:00
Matthias Krüger
174bbfb369
Rollup merge of #137686 - nbdd0121:asm_const, r=compiler-errors
Handle asm const similar to inline const

Previously, asm consts are handled similar to anon consts rather than inline consts. Anon consts are not good at dealing with lifetimes, because `type_of` has lifetimes erased already. Inline consts can deal with lifetimes because they live in an outer typeck context. And since `global_asm!` lacks an outer typeck context, we have implemented asm consts with anon consts while they're in fact more similar to inline consts.

This was changed in #137180, and this means that handling asm consts as inline consts are possible. While as `@compiler-errors` pointed out, `const` currently can't be used with any types with lifetime, this is about to change if #128464 is implemented. This PR is a preparatory PR for that feature.

As an unintentional side effect, fix #117877.

cc `@Amanieu`
r? `@compiler-errors`
2025-03-01 05:49:52 +01:00
Matthias Krüger
51e0976441
Rollup merge of #137171 - makai410:swapping-e0277, r=compiler-errors
Suggest swapping equality on E0277

Closes: #132695 .
2025-03-01 05:49:51 +01:00
Matthias Krüger
91eb721cbc
Rollup merge of #137045 - BoxyUwU:defer_repeat_expr_checks, r=compiler-errors
Defer repeat expr `Copy` checks to end of type checking

Fixes #110443

Defers repeat expr checks that the element type is `Copy` when the length is > 1 (or generic) to end of typeck so that under `generic_arg_infer` repeat exprs are able to have an inferred count, e.g. `let a: [_; 1] = [String::new(); _];`.

Currently the deferring is gated under `generic_arg_infer` though I intend to separately types FCP deferring the checks even outside of `generic_arg_infer` if we wind up not going with an alternative.
2025-03-01 05:49:50 +01:00
bors
30508faeb3 Auto merge of #137796 - jieyouxu:rollup-qt9yr1g, r=jieyouxu
Rollup of 10 pull requests

Successful merges:

 - #134943 (Add FileCheck annotations to mir-opt/issues)
 - #137017 (Don't error when adding a staticlib with bitcode files compiled by newer LLVM)
 - #137197 (Update some comparison codegen tests now that they pass in LLVM20)
 - #137540 (Fix (more) test directives that were accidentally ignored)
 - #137551 (import `simd_` intrinsics)
 - #137599 (tests: use minicore more)
 - #137673 (Fix Windows `Command` search path bug)
 - #137676 (linker: Fix escaping style for response files on Windows)
 - #137693 (Re-enable `--generate-link-to-defintion` for tools internal rustdoc)
 - #137770 (Fix sized constraint for unsafe binder)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-01 00:53:19 +00:00
Folkert de Vries
854e9f4803
intrinsics::simd: document that masks must be signed integer vectors
this is because they may be widened, and that only works when sign extension is used: zero extension would produce invalid results
2025-03-01 00:28:47 +01:00
Folkert de Vries
45492662c7
correct the docs on simd_ comparison operators
these all also accept integer vectors as arguments
2025-03-01 00:18:54 +01:00
Philipp Krones
7bfea66652
Update Cargo.lock 2025-02-28 23:28:53 +01:00
Philipp Krones
1e4bce2ee1
Fix link to ty::Ty in clippy_utils 2025-02-28 23:27:26 +01:00
Philipp Krones
f5851e7045
Clippy: skip check_host_compiler check in rustc testsuite
This test only makes sense to run in the Clippy repo

In the Rust repo the name of the host_compiler is dev, not nightly
2025-02-28 23:27:22 +01:00
Philipp Krones
65eb2b2237
Merge commit '9f9a822509e5ad3e560cbbe830d1013f936fca28' into clippy-subtree-update 2025-02-28 23:27:09 +01:00
bors
aa3c2d73ef Auto merge of #137517 - nnethercote:rm-NtPat-NtItem-NtStmt, r=petrochenkov
Remove `NtPat`, `NtMeta`, and `NtPath`

Another part of #124141.

r? `@petrochenkov`
2025-02-28 21:32:39 +00:00
Luigi Sartor Piucco
4c1f51bf6e
Fix link failure on AVR (incompatible ISA error)
Fixes #137739. A reproducer of the issue is present there. I believe the
root cause was introducing the avr-none target (which has no CPU by
default) and trying to get the ISA revision from there. This commit
uses the `target-cpu` option instead, which is already required to be
present for the target.

Co-authored-by: tones111 <tones111@users.noreply.github.com>
2025-02-28 18:27:35 -03:00
Esteban Küber
adb5ecabdb Tweak invalid RTN errors
Make suggestions verbose.

When encountering `method(type)` bound, suggest `method(..)` instead of `method()`.

```
error: argument types not allowed with return type notation
  --> $DIR/bad-inputs-and-output.rs:9:23
   |
LL | fn foo<T: Trait<method(i32): Send>>() {}
   |                       ^^^^^
   |
help: remove the input types
   |
LL - fn foo<T: Trait<method(i32): Send>>() {}
LL + fn foo<T: Trait<method(..): Send>>() {}
   |
```

When encountering both return type and arg list that isn't `..`, suggest replacing both.

```
error: return type not allowed with return type notation
  --> $DIR/bad-inputs-and-output.rs:12:25
   |
LL | fn bar<T: Trait<method() -> (): Send>>() {}
   |                         ^^^^^^
   |
help: use the right argument notation and remove the return type
   |
LL - fn bar<T: Trait<method() -> (): Send>>() {}
LL + fn bar<T: Trait<method(..): Send>>() {}
   |
```

When encountering a return type, suggest removing it including the leading whitespace.

```
error: return type not allowed with return type notation
  --> $DIR/bad-inputs-and-output.rs:24:45
   |
LL | fn bay_path<T: Trait>() where T::method(..) -> (): Send {}
   |                                             ^^^^^
   |
help: remove the return type
   |
LL - fn bay_path<T: Trait>() where T::method(..) -> (): Send {}
LL + fn bay_path<T: Trait>() where T::method(..): Send {}
   |
```
2025-02-28 21:18:53 +00:00
Timo
9f9a822509
Check for MSRV attributes in late passes using the HIR (#13821)
Closes https://github.com/rust-lang/rust-clippy/issues/13169

Late lints now use a parent iter to check for `#[clippy::msrv]`
attributes instead of keeping track with `extract_msrv_attr`. This is
required for incremental lints since they run per module instead of per
crate so don't visit all the necessary attributes

As a basic optimisation if no `#[clippy::msrv]` attributes are
discovered in early passes the HIR access is skipped completely and just
the configured MSRV is used, for most code bases this will be the case

changelog: none
2025-02-28 20:48:55 +00:00