Commit Graph

46938 Commits

Author SHA1 Message Date
bors
ba55b7ce3c Auto merge of #141730 - osiewicz:collect-crate-deps-postorder-use-indexset, r=nnethercote
cstore: Use IndexSet as backing store for postorder dependencies

`<rustc_metadata::creader::CStore>::push_dependencies_in_postorder` showed up in new benchmarks from https://github.com/rust-lang/rustc-perf/pull/2143, hence I gave it a shot to remove an obvious O(n) there.

r? nnethercote
2025-06-01 07:40:52 +00:00
bors
13a4540908 Auto merge of #141725 - nnethercote:avoid-UsePath-overcounting, r=BoxyUwU
Avoid over-counting of `UsePath` in the HIR stats.

Currently we over-count. Details in the individual commits.

r? `@BoxyUwU`
2025-06-01 04:21:50 +00:00
bors
337c11e593 Auto merge of #141842 - jhpratt:rollup-r7ldrl2, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#141072 (Stabilize feature `result_flattening`)
 - rust-lang/rust#141215 (std: clarify Clone trait documentation about duplication semantics)
 - rust-lang/rust#141277 (Miri CI: test aarch64-apple-darwin in PRs instead of the x86_64 target)
 - rust-lang/rust#141521 (Add `const` support for float rounding methods)
 - rust-lang/rust#141812 (Fix "consider borrowing" for else-if)
 - rust-lang/rust#141832 (library: explain TOCTOU races in `fs::remove_dir_all`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-01 01:02:51 +00:00
Jacob Pratt
542dcbf6a2
Rollup merge of #141812 - JonathanBrouwer:fix-else-if-help, r=jdonszelmann
Fix "consider borrowing" for else-if

Fixes rust-lang/rust#141810

When trying to suggest a borrow on a `if` or `block` expression, instead we now recurse into the `if` or `block`.
The comments in the code should explain the goal of the new code.

r? ``@jdonszelmann``
2025-06-01 00:35:53 +02:00
Jacob Pratt
ac49339e03
Rollup merge of #141521 - ruancomelli:const-float-rounding, r=RalfJung
Add `const` support for float rounding methods

# Add `const` support for float rounding methods

This PR makes the following float rounding methods `const`:

- `f64::{floor, ceil, trunc, round, round_ties_even}`
- and the corresponding methods for `f16`, `f32` and `f128`

Tracking issue: https://github.com/rust-lang/rust/issues/141555

## Procedure

I followed c09ed3e767 as closely as I could in making float methods `const`, and also received great guidance from https://internals.rust-lang.org/t/const-rounding-methods-in-float-types/22957/3?u=ruancomelli.

## Note

This is my first code contribution to the Rust project, so please let me know if I missed anything - I'd be more than happy to revise and learn more. Thank you for taking the time to review it!
2025-06-01 00:35:53 +02:00
Jacob Pratt
241ec137fb
Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=jhpratt
Stabilize feature `result_flattening`

Stabilizes the `Result::flatten` method

## Implementations

- [x] Implementation `Result::flatten`: https://github.com/rust-lang/rust/pull/70140
- [x] Implementation `const` `Result::flatten`: https://github.com/rust-lang/rust/pull/130692
- [x] Update stabilization attribute macros (this PR)

## Stabilization process

- [x] Created this PR [suggested](https://github.com/rust-lang/rust/issues/70142#issuecomment-2885044548) by ``@RalfJung``
- [x] FCP (haven't found any, is it applicable here?)
- [ ] Close issue rust-lang/rust#70142
2025-06-01 00:35:50 +02:00
bors
f0999ffdc4 Auto merge of #139118 - scottmcm:slice-get-unchecked-intrinsic, r=workingjubilee
`slice.get(i)` should use a slice projection in MIR, like `slice[i]` does

`slice[i]` is built-in magic, so ends up being quite different from `slice.get(i)` in MIR, even though they're both doing nearly identical operations -- checking the length of the slice then getting a ref/ptr to the element if it's in-bounds.

This PR adds a `slice_get_unchecked` intrinsic for `impl SliceIndex for usize` to use to fix that, so it no longer needs to do a bunch of lines of pointer math and instead just gets the obvious single statement.  (This is *not* used for the range versions, since `slice[i..]` and `slice[..k]` can't use the mir Slice projection as they're using fenceposts, not indices.)

I originally tried to do this with some kind of GVN pattern, but realized that I'm pretty sure it's not legal to optimize `BinOp::Offset` to `PlaceElem::Index` without an extremely complicated condition.  Basically, the problem is that the `Index` projection on a dereferenced slice pointer *cares about the metadata*, since it's UB to `PlaceElem::Index` outside the range described by the metadata.  But then you cast the fat pointer to a thin pointer then offset it, that *ignores* the slice length metadata, so it's possible to write things that are legal with `Offset` but would be UB if translated in the obvious way to `Index`.  Checking (or even determining) the necessary conditions for that would be complicated and error-prone, whereas this intrinsic-based approach is quite straight-forward.

Zero backend changes, because it just lowers to MIR, so it's already supported naturally by CTFE/Miri/cg_llvm/cg_clif.
2025-05-31 21:38:21 +00:00
Ruan Comelli
f8e97badb2
Add const support for float rounding methods
Add const support for the float rounding methods floor, ceil, trunc,
fract, round and round_ties_even.
This works by moving the calculation logic from

     src/tools/miri/src/intrinsics/mod.rs

into

     compiler/rustc_const_eval/src/interpret/intrinsics.rs.

All relevant method definitions were adjusted to include the `const`
keyword for all supported float types: f16, f32, f64 and f128.

The constness is hidden behind the feature gate

     feature(const_float_round_methods)

which is tracked in

     https://github.com/rust-lang/rust/issues/141555

This commit is a squash of the following commits:
- test: add tests that we expect to pass when float rounding becomes const
- feat: make float rounding methods `const`
- fix: replace `rustc_allow_const_fn_unstable(core_intrinsics)` attribute with `#[rustc_const_unstable(feature = "f128", issue = "116909")]` in `library/core/src/num/f128.rs`
- revert: undo update to `library/stdarch`
- refactor: replace multiple `float_<mode>_intrinsic` rounding methods with a single, parametrized one
- fix: add `#[cfg(not(bootstrap))]` to new const method tests
- test: add extra sign tests to check `+0.0` and `-0.0`
- revert: undo accidental changes to `round` docs
- fix: gate `const` float round method behind `const_float_round_methods`
- fix: remove unnecessary `#![feature(const_float_methods)]`
- fix: remove unnecessary `#![feature(const_float_methods)]` [2]
- revert: undo changes to `tests/ui/consts/const-eval/float_methods.rs`
- fix: adjust after rebase
- test: fix float tests
- test: add tests for `fract`
- chore: add commented-out `const_float_round_methods` feature gates to `f16` and `f128`
- fix: adjust NaN when rounding floats
- chore: add FIXME comment for de-duplicating float tests
- test: remove unnecessary test file `tests/ui/consts/const-eval/float_methods.rs`
- test: fix tests after upstream simplification of how float tests are run
2025-05-31 15:26:57 -03:00
Matthias Krüger
0254c67b1a
Rollup merge of #141815 - mati865:mingw-aarch64-frame-pointers, r=workingjubilee
Enable non-leaf Frame Pointers for mingw-w64 Arm64 Windows

Based on https://github.com/rust-lang/rust/pull/140828

I don't have AArch64 Windows to test it, but I trust LLVM to handle it well.
2025-05-31 18:51:51 +02:00
Matthias Krüger
387170c74b
Rollup merge of #141740 - nnethercote:hir-ItemKind-field-order, r=fee1-dead
Hir item kind field order

A follow-up to rust-lang/rust#141675.

r? `@fee1-dead`
2025-05-31 18:51:48 +02:00
Matthias Krüger
05debb0d0d
Rollup merge of #140787 - xizheyin:issue-140491, r=nnethercote
Note expr being cast when encounter NonScalar cast error

Fixes #140491

I added note for `expr` so that it doesn't treat `&x as T` as `&(x as T)` but `(&x) as T`. But I'm not sure if I want to add note for all NonScalar, maybe for specific `expr_ty`?

r? compiler
2025-05-31 18:51:47 +02:00
Jonathan Brouwer
b1a1df2efe
Fix consider borrowing for else-if 2025-05-31 18:34:35 +02:00
Mateusz Mikuła
7e9aee773a Enable non-leaf Frame Pointers for mingw-w64 Arm64 Windows 2025-05-31 14:27:26 +02:00
bors
ec28ae9454 Auto merge of #141667 - lqd:lazy-maybe-init, r=matthewjasper
Add fast path for maybe-initializedness in liveness

r? `@matthewjasper`

Correct me if I'm wrong Matthew, but my understanding is that
1. `MaybeInitializedPlaces` is currently eagerly computed, in `do_mir_borrowck`
2. but this data is only used in liveness
3. and `liveness::trace` actually only uses it for drop-liveness

This PR moves the computation to `liveness::trace` which looks to be its only use-site. We also add a fast path there, so that it's only computed by drop-liveness.

This is interesting because 1) liveness is only computed for relevant live locals, 2) drop-liveness is only computed for relevant live locals with >0 drop points; 0 is the common case from our benchmarks, as far as I can tell, so even just computing the entire data lazily helps.

It seems possible to also reduce the domain here, and speed up the analysis for the cases where it has to be computed -- so I've left a fixme for that, and may look into it soon.

(I've come upon this while doing implementation work for polonius, so don't be too enamored with possible wins: the goal is to reduce the eventual polonius overhead and make it more palatable 😓)
2025-05-31 04:52:37 +00:00
xizheyin
17352e6937
Note ref expr being cast when encounter NonScalar cast error
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-31 12:19:55 +08:00
Jubilee
955ebfc7d3
Rollup merge of #141781 - matthewjasper:unused-unsafe-lifetimes, r=compiler-errors
Fix spans for unsafe binders

closes rust-lang/rust#141758

r? ``@compiler-errors``
2025-05-30 13:52:28 -07:00
Jubilee
3846f2f08f
Rollup merge of #141494 - dianqk:match-br-non-int, r=wesleywiser
mir-opt: Do not transform non-int type in match_branches

Fixes #141378.

r? mir-opt
2025-05-30 13:52:26 -07:00
Jubilee
5e139db47b
Rollup merge of #141077 - chenyukang:yukang-fix-140991-comma, r=wesleywiser
Fix the issue of typo of comma in arm parsing

Fixes #140991

I also checked is it a '/', since it's near from ',' from keyboard.
2025-05-30 13:52:25 -07:00
Scott McMurray
4668124cc7 slice.get(i) should use a slice projection in MIR, like slice[i] does 2025-05-30 12:04:41 -07:00
Matthew Jasper
4a1843924e Fix spans for unsafe binders 2025-05-30 16:58:48 +00:00
bors
15825b7161 Auto merge of #139385 - joboet:threadlocal_address, r=nikic
rustc_codegen_llvm: use `threadlocal.address` intrinsic to access TLS

Fixes #136044
r? `@nikic`
2025-05-30 15:39:56 +00:00
Matthias Krüger
4fce906481
Rollup merge of #141749 - Noratrieb:RUSTC_ACTUALLY_DO_NOT_RETRY_LINKER_ON_SEGFAULT, r=petrochenkov
Remove RUSTC_RETRY_LINKER_ON_SEGFAULT hack

It looks like this was added in rust-lang/rust#40422 6 years ago because of issues with the MacOS linker. MacOS got a new linker in the meantime, so that should probably be resolved now. Hopefully.

r? petrochenkov
2025-05-30 13:39:55 +02:00
Matthias Krüger
c61a1e0f9b
Rollup merge of #141719 - Berrysoft:cygwin-tls-model, r=mati865
Add tls_model for cygwin and enable has_thread_local

I've also tried to set `has_thread_local` to `true` and found it works actually. Why do we still implement our own `thread_local` instead of delegating all of them to LLVM?

cc: `@jeremyd2019`
2025-05-30 13:39:53 +02:00
Matthias Krüger
bace7f986c
Rollup merge of #141703 - compiler-errors:deref-place, r=lcnr
Structurally normalize types as needed in `projection_ty_core`

Introduce a `structurally_normalize` callback to `projection_ty_core`, and then use it before we match on the ty kind in `projection_ty_core`.

Previously we were only structurally normalizing the return type of the `handle_field` struct, but if we were to (e.g.) apply a deref projection to that type, then the resulting type is not guaranteed to be structurally normalized and any subsequent projections applied would ICE.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/221

I'll leave a few comments inline to explain the changes.

r? lcnr

---

Also fixes rust-lang/rust#141708
2025-05-30 13:39:52 +02:00
bors
6de3a73312 Auto merge of #141753 - matthiaskrgr:rollup-bw4j2u0, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#133823 (Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion)
 - rust-lang/rust#141004 (Report text_direction_codepoint_in_literal when parsing)
 - rust-lang/rust#141407 (Refactor the two-phase check for impls and impl items)
 - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - rust-lang/rust#141507 (atomic_load intrinsic: use const generic parameter for ordering)
 - rust-lang/rust#141538 (implement `va_arg` for x86_64 systemv)
 - rust-lang/rust#141669 (float: Replace some approximate assertions with exact)
 - rust-lang/rust#141747 (rustdoc: display doc(cfg(false)) properly)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-30 05:38:39 +00:00
Matthias Krüger
5023691213
Rollup merge of #141538 - folkertdev:systemv-x86_64-va_arg, r=workingjubilee
implement `va_arg` for x86_64 systemv

tracking issue: https://github.com/rust-lang/rust/issues/44930

Turns out LLVM's `va_arg` is also unreliable for this target.

https://github.com/llvm/llvm-project/issues/141361

So, like clang, we implement our own. I used

- the spec at https://gitlab.com/x86-psABIs/x86-64-ABI
- the clang implementation at 9a440f8477/clang/lib/CodeGen/Targets/X86.cpp (L3041)

We can take a bunch of shortcuts because the return type of `va_list` must implement `VaArgSafe`. I also extended some of the tests, because up to 11 floats can be stored in the `reg_safe_area` for this calling convention.

r? `@workingjubilee`
`@rustbot` label +F-c_variadic

try-job: x86_64-apple-1
2025-05-30 07:01:30 +02:00
Matthias Krüger
ad2d91ce11
Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3
atomic_load intrinsic: use const generic parameter for ordering

We have a gazillion intrinsics for the atomics because we encode the ordering into the intrinsic name rather than making it a parameter. This is particularly bad for those operations that take two orderings. Let's fix that!

This PR only converts `load`, to see if there's any feedback that would fundamentally change the strategy we pursue for the const generic intrinsics.

The first two commits are preparation and could be a separate PR if you prefer.

`@BoxyUwU` -- I hope this is a use of const generics that is unlikely to explode? All we need is a const generic of enum type. We could funnel it through an integer if we had to but an enum is obviously nicer...

`@bjorn3` it seems like the cranelift backend entirely ignores the ordering?
2025-05-30 07:01:30 +02:00
Matthias Krüger
a87bc9d9fe
Rollup merge of #141430 - fee1-dead-contrib:push-nmzoprvtsvww, r=petrochenkov
remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`

`visit_clobber` is not really useful except for one niche purpose
involving generic code. We should just use the replace logic where we
can.
2025-05-30 07:01:29 +02:00
Matthias Krüger
896be667b8
Rollup merge of #141407 - mu001999-contrib:dead-code/refactor, r=petrochenkov
Refactor the two-phase check for impls and impl items

Refactor the two-phase dead code check to make the logic clearer and simpler:
1. adding assoc fn and impl into `unsolved_items` directly during the initial construction of the worklist
2. converge the logic of checking whether assoc fn and impl are used to `item_should_be_checked`, and the item is considered used only when its corresponding trait and Self adt are used

This PR only refactors as much as possible to avoid affecting the original functions. However, due to the adjustment of the order of checks, the test results are slightly different, but overall, there is no regression problem

Fixes rust-lang/rust#127911
Fixes rust-lang/rust#128839

Extracted from https://github.com/rust-lang/rust/pull/128637.
r? petrochenkov

try-job: dist-aarch64-linux
2025-05-30 07:01:29 +02:00
Matthias Krüger
5fc3f26748
Rollup merge of #141004 - matthewjasper:unicode-before-expansion, r=davidtwco
Report text_direction_codepoint_in_literal when parsing

The lint is now reported in code that gets removed/modified/duplicated by macro expansion, and spans are more accurate so we don't get ICEs from trying to split a span in the middle of a character.

This removes support for lint level attributes for `text_direction_codepoint_in_literal` except at the crate level, I don't think that there's an easy way around this when the lint can be reported on code that's removed by `cfg` or that is only in the input of a macro.

Fixes #140281
2025-05-30 07:01:28 +02:00
Matthias Krüger
7aba37da44
Rollup merge of #133823 - estebank:issue-56328, r=petrochenkov
Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion

In rust-lang/rust#138515, we insert a placeholder attribute so that checks for attributes can still know about the placement of `cfg` attributes. When we suggest removing items with `cfg_attr`s (fix rust-lang/rust#56328) and make them verbose. We tweak the wording of the existing "unused `extern crate`" lint.

```
warning: unused `extern crate`
  --> $DIR/removing-extern-crate.rs:9:1
   |
LL | extern crate removing_extern_crate as foo;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused
   |
note: the lint level is defined here
  --> $DIR/removing-extern-crate.rs:6:9
   |
LL | #![warn(rust_2018_idioms)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]`
help: remove the unused `extern crate`
   |
LL - #[cfg_attr(test, macro_use)]
LL - extern crate removing_extern_crate as foo;
   |
```

r? `@petrochenkov`

try-job: x86_64-gnu-aux
2025-05-30 07:01:27 +02:00
bors
1c0849d8ba Auto merge of #141651 - compiler-errors:less-assert, r=lcnr
Make some assertions in solver into debug assertions

These may or may not be expensive :>

r? lcnr
2025-05-30 02:21:17 +00:00
bors
1ac1950c33 Auto merge of #141739 - GuillaumeGomez:rollup-ivboqwd, r=GuillaumeGomez
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#137574 (Make `std/src/num` mirror `core/src/num`)
 - rust-lang/rust#141384 (Enable review queue tracking)
 - rust-lang/rust#141448 (A variety of improvements to the codegen backends)
 - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors)
 - rust-lang/rust#141676 (float: Disable `total_cmp` sNaN tests for `f16`)
 - rust-lang/rust#141705 (Add eslint as part of `tidy` run)
 - rust-lang/rust#141715 (Add `loongarch64` with `d` feature to `f32::midpoint` fast path)
 - rust-lang/rust#141723 (Provide secrets to try builds with new bors)
 - rust-lang/rust#141728 (Fix false documentation of FnCtxt::diverges)
 - rust-lang/rust#141729 (resolve target-libdir directly from rustc)
 - rust-lang/rust#141732 (creader: Remove extraenous String::clone)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-29 23:02:31 +00:00
Noratrieb
f1778074fb Remove RUSTC_RETRY_LINKER_ON_SEGFAULT hack
It looks like this was added 6 years ago because of issues with the
MacOS linker. MacOS got a new linker in the meantime, so that should
probably be resolved now. Hopefully.
2025-05-29 23:30:29 +02:00
Piotr Osiewicz
5e61f5ef3e Erase return type of crate_dependencies_in_reverse_postorder 2025-05-29 22:42:56 +02:00
Folkert de Vries
94cc72682e
implement va_arg for x86_64 systemv and macOS
Turns out LLVM's `va_arg` is also unreliable for this target, so we need
our own implementation.
2025-05-29 22:06:02 +02:00
Nicholas Nethercote
aa3009dff6 Reorder hir fn stuff.
In `Fn`, put `ident` next to `generics` as is common in many other
types.

In `print_fn`, make the argument order match the printing order.
2025-05-30 02:28:35 +10:00
Nicholas Nethercote
f8887aa5af Reorder fields in hir::ItemKind variants.
Specifically `TyAlias`, `Enum`, `Struct`, `Union`. So the fields match
the textual order in the source code.

The interesting part of the change is in
`compiler/rustc_hir/src/hir.rs`. The rest is extremely mechanical
refactoring.
2025-05-30 02:23:20 +10:00
Berrysoft
9281958c6a Add tls_model for cygwin and enable has_thread_local 2025-05-30 00:23:18 +08:00
Guillaume Gomez
18646a8a7f
Rollup merge of #141732 - osiewicz:creader-remove-extraenous-string-clone, r=Kobzol
creader: Remove extraenous String::clone

A leftover from rust-lang/rust#132910
2025-05-29 17:03:03 +02:00
Guillaume Gomez
710fa11737
Rollup merge of #141728 - JonathanBrouwer:fix-docs, r=compiler-errors
Fix false documentation of FnCtxt::diverges

While I was working on another issue I came across this false documentation, and was mislead by it.
Therefore I decided to fix this :)

The newly documented usecase is located here: 38081f22c2/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs (L1968)
2025-05-29 17:03:02 +02:00
Guillaume Gomez
2b08e4d399
Rollup merge of #141636 - fee1-dead-contrib:push-ntqvvxwuvrvx, r=petrochenkov
avoid some usages of `&mut P<T>` in AST visitors

It's a double indirection, and is also complicating our efforts at rust-lang/rust#127615.

r? `@ghost`
2025-05-29 17:02:59 +02:00
Guillaume Gomez
161cf3e25b
Rollup merge of #141448 - bjorn3:codegen_refactors, r=WaffleLapkin
A variety of improvements to the codegen backends

Some are just general improvements to cg_ssa or cg_llvm, while others will make it slightly easier to use cg_ssa in cg_clif in the future.
2025-05-29 17:02:59 +02:00
joboet
e4d9b06cc8
rustc_codegen_llvm: use threadlocal.address intrinsic to access TLS 2025-05-29 16:07:43 +02:00
bors
13718eb788 Auto merge of #141595 - bjorn3:rustc_no_sysroot_proc_macro, r=onur-ozkan
Do not get proc_macro from the sysroot in rustc

With the stage0 refactor the proc_macro version found in the sysroot will no longer always match the proc_macro version that proc-macros get compiled with by the rustc executable that uses this proc_macro. This will cause problems as soon as the ABI of the bridge gets changed to implement new features or change the way existing features work.

To fix this, this commit changes rustc crates to depend directly on the local version of proc_macro which will also be used in the sysroot that rustc will build.
2025-05-29 12:07:53 +00:00
Michael Goulet
9871e160ea Normalize possibly unnormalized type in relate_type_and_user_type 2025-05-29 11:20:45 +00:00
Piotr Osiewicz
8c8d2c2e12 creader: Remove extraenous String::clone 2025-05-29 13:17:29 +02:00
Michael Goulet
2a339ce492 Structurally normalize types as needed in projection_ty_core 2025-05-29 11:16:44 +00:00
Piotr Osiewicz
9b3be2599a cstore: Use IndexSet as backing store for postorder dependencies
<rustc_metadata::creader::CStore>::push_dependencies_in_postorder showed up in new benchmarks from https://github.com/rust-lang/rustc-perf/pull/2143, hence I gave it a shot to remove an obvious O(n) there.
2025-05-29 13:02:20 +02:00
Esteban Küber
f80e3ac4ed Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics
PR 138515, we insert a placeholder attribute so that checks for attributes can still know about the placement of `cfg` attributes. When we suggest removing items with `cfg_attr`s (fix Issue 56328) and make them verbose. We tweak the wording of the existing "unused `extern crate`" lint.

```
warning: unused extern crate
  --> $DIR/removing-extern-crate.rs:9:1
   |
LL | extern crate removing_extern_crate as foo;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused
   |
note: the lint level is defined here
  --> $DIR/removing-extern-crate.rs:6:9
   |
LL | #![warn(rust_2018_idioms)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]`
help: remove the unused `extern crate`
   |
LL - #[cfg_attr(test, macro_use)]
LL - extern crate removing_extern_crate as foo;
LL +
   |
```
2025-05-29 10:24:23 +00:00