Commit Graph

546 Commits

Author SHA1 Message Date
Nicholas Nethercote
84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Mark Rousskov
5eca36d27a step cfg(bootstrap) 2024-07-28 14:46:29 -04:00
Matthias Krüger
cc17ca2414
Rollup merge of #125889 - Nilstrieb:migrate-into-the-future, r=compiler-errors
Add migration lint for 2024 prelude additions

This adds the migration lint for the newly ambiguous methods `poll` and `into_future`. When these methods are used on types implementing the respective traits, it will be ambiguous in the future, which can lead to hard errors or behavior changes depending on the exact circumstances.

tracked by #121042

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->
r? compiler-errors as the method prober
2024-07-28 13:42:18 +02:00
Nilstrieb
6f662176e7 Add migration lint for 2024 prelude additions
This adds the migration lint for the newly ambiguous methods `poll` and
`into_future`. When these methods are used on types implementing the
respective traits, it will be ambiguous in the future, which can lead to
hard errors or behavior changes depending on the exact circumstances.
2024-07-28 11:44:03 +02:00
Slanterns
ec0b354092
stabilize is_sorted 2024-07-28 03:11:54 +08:00
Ralf Jung
bda31d14f4 built-in derive: remove BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE hack and lint 2024-07-27 18:18:41 +02:00
Trevor Gross
c9886a1ddf Mark missing_fragment_specifier as FutureReleaseErrorReportInDeps
We are moving toward forbidding `missing_fragment_specifier` either in
edition 2024 or unconditionally. Make a first step toward this by
ensuring crates that rely on the old behavior are reported when used as
dependencies.

Tracking issue: <https://github.com/rust-lang/rust/issues/128143>
2024-07-24 13:16:46 -04:00
Santiago Pastorino
8366c7fe9c
Stabilize unsafe extern blocks (RFC 3484) 2024-07-23 00:29:39 -03:00
Trevor Gross
81135a015f
Rollup merge of #125990 - tbu-:pr_unsafe_env_lint_name, r=ehuss
Rename `deprecated_safe` lint to `deprecated_safe_2024`

Create a lint group `deprecated_safe` that includes `deprecated_safe_2024`.

Addresses https://github.com/rust-lang/rust/issues/124866#issuecomment-2142814375.

r? `@ehuss`
2024-07-22 11:40:19 -05:00
Ralf Jung
0871175a4d make pub_use_of_private_extern_crate show up in future breakage reports 2024-07-18 13:43:56 +02:00
Tobias Bucher
bf96c56e84 Rename deprecated_safe lint to deprecated_safe_2024
Create a lint group `deprecated_safe` that includes
`deprecated_safe_2024`.

Addresses https://github.com/rust-lang/rust/issues/124866#issuecomment-2142814375.
2024-07-17 14:39:56 +02:00
Ralf Jung
9d9b55cd2b make invalid_type_param_default lint show up in cargo future-compat reports
and remove the feature gate that silenced the lint
2024-07-15 22:05:45 +02:00
bors
9b0043095a Auto merge of #127097 - compiler-errors:async-closure-lint, r=oli-obk
Implement simple, unstable lint to suggest turning closure-of-async-block into async-closure

We want to eventually suggest people to turn `|| async {}` to `async || {}`. This begins doing that. It's a pretty rudimentary lint, but I wanted to get something down so I wouldn't lose the code.

Tracking:
* #62290
2024-07-11 06:59:10 +00:00
Jacob Pratt
de143cf992
Rollup merge of #124211 - compiler-errors:bump-elided_lifetimes_in_associated_constant, r=BoxyUwU
Bump `elided_lifetimes_in_associated_constant` to deny

It's been 5 versions since this was last bumped. Let's bump it up again.
2024-07-10 00:37:10 -04:00
Matthias Krüger
c4ee2df539
Rollup merge of #120248 - WaffleLapkin:bonk-ptr-object-casts, r=compiler-errors,oli-obk,lnicola
Make casts of pointers to trait objects stricter

This is an attempt to `fix` https://github.com/rust-lang/rust/issues/120222 and https://github.com/rust-lang/rust/issues/120217.

This is done by adding restrictions on casting pointers to trait objects.

Before this PR the rules were as follows:

> When casting `*const X<dyn A>` -> `*const Y<dyn B>`, principal traits in `A` and `B` must refer to the same trait definition (or no trait).

With this PR the rules are changed to

> When casting `*const X<dyn Src>` -> `*const Y<dyn Dst>`
> - if `Dst` has a principal trait `DstP`,
>   - `Src` must have a principal trait `SrcP`
>   - `dyn SrcP` and `dyn DstP` must be the same type (modulo the trait object lifetime, `dyn T+'a` -> `dyn T+'b` is allowed)
>   - Auto traits in `Dst` must be a subset of auto traits in `Src`
>     - Not adhering to this is currently a FCW (warn-by-default + `FutureReleaseErrorReportInDeps`), instead of an error
> - if `Src` has a principal trait `Dst` must as well
>   - this restriction will be removed in a follow up PR

This ensures that
1. Principal trait's generic arguments match (no `*const dyn Tr<A>` -> `*const dyn Tr<B>` casts, which are a problem for [#120222](https://github.com/rust-lang/rust/issues/120222))
2. Principal trait's lifetime arguments match (no `*const dyn Tr<'a>` -> `*const dyn Tr<'b>` casts, which are a problem for [#120217](https://github.com/rust-lang/rust/issues/120217))
3. No auto traits can be _added_ (this is a problem for arbitrary self types, see [this comment](https://github.com/rust-lang/rust/pull/120248#discussion_r1463835350))

Some notes:
 - We only care about the metadata/last field, so you can still cast `*const dyn T` to `*const WithHeader<dyn T>`, etc
- The lifetime of the trait object itself (`dyn A + 'lt`) is not checked, so you can still cast `*mut FnOnce() + '_` to `*mut FnOnce() + 'static`, etc
  - This feels fishy, but I couldn't come up with a reason it must be checked

The diagnostics are currently not great, to say the least, but as far as I can tell this correctly fixes the issues.

cc `@oli-obk` `@compiler-errors` `@lcnr`
2024-07-08 16:28:15 +02:00
许杰友 Jieyou Xu (Joe)
29c1a43403
Rollup merge of #126881 - WaffleLapkin:unsafe-code-affected-by-fallback-hard-in-2024, r=compiler-errors
Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` a deny-by-default lint in edition 2024

I don't actually really care about this, but ``@traviscross`` asked me to do this, because lang team briefly discussed this before.

(TC here:)

Specifically, our original FCPed plan included this step:

- Add a lint against fallback affecting a generic that is passed to an `unsafe` function.
   - Perhaps make this lint `deny-by-default` or a hard error in Rust 2024.

That is, we had left as an open question strengthening this in Rust 2024, and had marked it as an open question on the tracking issue.  We're nominating here to address the open question.  (Closing the remaining open question helps us to fully mark this off for Rust 2024.)

r? ``@compiler-errors``

Tracking:

- https://github.com/rust-lang/rust/issues/123748
2024-07-08 13:04:30 +08:00
Maybe Lapkin
9ef533e8de Fill in tracking issue 2024-07-04 17:57:31 +02:00
Maybe Lapkin
340d69be12 Align the changes to the lang decision 2024-07-04 17:57:29 +02:00
beetrees
4c919ac50b
Ensure out_of_scope_macro_calls lint is registered 2024-07-01 00:25:25 +01:00
Michael Goulet
6f3ad0a40b Only require symbol name for @feature_gate 2024-06-28 18:33:31 -04:00
Maybe Lapkin
18c248b656 Make NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE deny-by-default in e2024 2024-06-28 22:23:43 +02:00
Michael Goulet
eb92923276 Bump elided_lifetimes_in_associated_constant 2024-06-28 11:04:14 -04:00
xFrednet
b124b3666e
sudo CI=green && Review changes <3 2024-06-25 18:06:22 +02:00
xFrednet
8b14e23dce
RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
Vadim Petrochenkov
c4c7859e40 resolve: Implement a lint for out-of-scope use of macro_rules 2024-06-24 17:12:08 +03:00
carbotaniuman
a23917cfd0 Add hard error and migration lint for unsafe attrs 2024-06-23 19:02:14 -05:00
Nicholas Nethercote
9981d61cdb Remove useless tidy-alphabetical markers.
rustfmt already sorts `use` declarations within the same group.
2024-06-20 09:23:20 +10:00
Michael Goulet
4f97ab54c4 Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope 2024-06-14 11:05:35 -04:00
Waffle Lapkin
8400cd0b34 Fixup links in lint docs
looks like prim@ stuff does not work here (is it possibly not handled by rustdoc at all?)
2024-06-13 12:24:31 +02:00
Waffle Lapkin
83f8f9f85d Implement lint for obligations broken by never type fallback change 2024-06-13 12:24:31 +02:00
Jubilee
9d946a3f6f
Rollup merge of #126356 - epage:check-cfg, r=Urgau
docs(rustc): Improve discoverable of Cargo docs

In preparing Cargo's blog post for 1.80, I tried to find the documentation for the lint configuration and I couldn't.  The link is only visible from the lint itself, which isn't where I started, and the side bar, which was collapsed for me.

The first place I went was the docs for `unexpected_cfgs` because this is configuration for that lint.  If using lint configuration were a one off, I could see skipping it here.  However, when we discussed this with at least one T-compiler member, there was interest in using this for other lints in the future.  To that end, it seems like we should be exposing this with the lint itself.

The second place I checked was the `check-cfg` documentation.  This now has a call out for the sub-page.
2024-06-12 20:03:22 -07:00
Ed Page
9232bd2e83 docs(rustc): Link unexpected_cfgs to the Cargo.toml docs
This is the first time we have a lint with configuration exposed in
`Cargo.toml`.
When this was done, interest was expressed in using this for other cases
in the future.
To this end, we need to make the documentation for the lint
configuration discoverable from the documentation for that lint.
2024-06-12 15:27:27 -05:00
Nicholas Nethercote
75b164d836 Use tidy to sort crate attributes for all compiler crates.
We already do this for a number of crates, e.g. `rustc_middle`,
`rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.

For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g.
  `allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes),
  sometimes the order is alphabetical, and sometimes there is no
  particular order.
- Sometimes the attributes of a particular kind aren't even grouped
  all together, e.g. there might be a `feature`, then an `allow`, then
  another `feature`.

This commit extends the existing sorting to all compiler crates,
increasing consistency. If any new attribute line is added there is now
only one place it can go -- no need for arbitrary decisions.

Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
  because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
  ignored in `rustfmt.toml`).
2024-06-12 15:49:10 +10:00
许杰友 Jieyou Xu (Joe)
81ff9b5770
Rollup merge of #125913 - fmease:early-lints-spruce-up-some-diags, r=Nadrieril
Spruce up the diagnostics of some early lints

Implement the various "*(note to myself) in a follow-up PR we should turn parts of this message into a subdiagnostic (help msg or even struct sugg)*" drive-by comments I left in #124417 during my review.

For context, before #124417, only a few early lints touched/decorated/customized their diagnostic because the former API made it a bit awkward. Likely because of that, things that should've been subdiagnostics were just crammed into the primary message. This PR rectifies this.
2024-06-11 09:14:34 +01:00
bors
2d28b6384e Auto merge of #124482 - spastorino:unsafe-extern-blocks, r=oli-obk
Unsafe extern blocks

This implements RFC 3484.

Tracking issue #123743 and RFC https://github.com/rust-lang/rfcs/pull/3484

This is better reviewed commit by commit.
2024-06-06 08:14:58 +00:00
Santiago Pastorino
1afc7d716c
Make MISSING_UNSAFE_ON_EXTERN lint emit future compat info with suggestion to prepend unsafe 2024-06-05 09:36:01 -03:00
Santiago Pastorino
0380321e78
Add unsafe_extern_blocks feature flag 2024-06-05 09:35:57 -03:00
Guillaume Gomez
fa96e2cb4f
Rollup merge of #125596 - nnethercote:rental-hard-error, r=estebank
Convert `proc_macro_back_compat` lint to an unconditional error.

We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour.

The original "hack" implementing alternative behaviour was added in #73345.

The lint was added in #83127.

The tracking issue is #83125.

The direct motivation for the change is that providing the alternative behaviour is interfering with #125174 and follow-on work.

r? ``@estebank``
2024-06-04 21:41:33 +02:00
Santiago Pastorino
3ba8de0b60
Make extern blocks without unsafe warn in edition 2024 2024-06-04 14:19:42 -03:00
Michael Goulet
de6b219803 Make WHERE_CLAUSES_OBJECT_SAFETY a regular object safety violation 2024-06-03 09:49:04 -04:00
León Orell Valerian Liehr
b2949ff911
Spruce up the diagnostics of some early lints 2024-06-03 07:25:32 +02:00
Tobias Bucher
44f9f8bc33 Add deprecated_safe lint
It warns about usages of `std::env::{set_var, remove_var}` with an
automatic fix wrapping the call in an `unsafe` block.
2024-05-30 00:20:48 +02:00
Nicholas Nethercote
cf0c2c7333 Convert proc_macro_back_compat lint to an unconditional error.
We still check for the `rental`/`allsorts-rental` crates. But now if
they are detected we just emit a fatal error, instead of emitting a
warning and providing alternative behaviour.

The original "hack" implementing alternative behaviour was added
in #73345.

The lint was added in #83127.

The tracking issue is #83125.

The direct motivation for the change is that providing the alternative
behaviour is interfering with #125174 and follow-on work.
2024-05-28 08:15:15 +10:00
Guillaume Gomez
ad37f40355
Rollup merge of #125522 - spastorino:fix-lint-docs-edition-handling, r=Urgau,michaelwoerister
Add "better" edition handling on lint-docs tool

r? `@Urgau`
2024-05-27 13:10:34 +02:00
bors
b582f807fa Auto merge of #125410 - fmease:adj-lint-diag-api, r=nnethercote
[perf] Delay the construction of early lint diag structs

Attacks some of the perf regressions from https://github.com/rust-lang/rust/pull/124417#issuecomment-2123700666.

See individual commits for details. The first three commits are not strictly necessary.
However, the 2nd one (06bc4fc671, *Remove `LintDiagnostic::msg`*) makes the main change way nicer to implement.
It's also pretty sweet on its own if I may say so myself.
2024-05-27 08:44:12 +00:00
bors
5fe5543502 Auto merge of #124661 - RalfJung:only-structural-consts-in-patterns, r=pnkfelix
Turn remaining non-structural-const-in-pattern lints into hard errors

This completes the implementation of https://github.com/rust-lang/rust/issues/120362 by turning our remaining future-compat lints into hard errors: indirect_structural_match and pointer_structural_match.

They have been future-compat lints for a while (indirect_structural_match for many years, pointer_structural_match since Rust 1.75 (released Dec 28, 2023)), and have shown up in dependency breakage reports since Rust 1.78 (just released on May 2, 2024). I don't expect a lot of code will still depend on them, but we will of course do a crater run.

A lot of cleanup is now possible in const_to_pat, but that is deferred to a later PR.

Fixes https://github.com/rust-lang/rust/issues/70861
2024-05-26 07:55:47 +00:00
Santiago Pastorino
41d4a95fca
Add "better" edition handling on lint-docs tool 2024-05-24 23:58:27 -03:00
León Orell Valerian Liehr
366ef95407
Slightly clean up some lint infra code
* inline `LintBuffer::add_lint`, it only had a single use
* update a lint infra example code snippet
  * it used the wrong API (the snippet isn't tested)
  * presumably the arguments were updated from builder to diag struct style
    at some point without updating the method
2024-05-23 03:21:12 +02:00
Xiretza
98dd6c7e8f Rename buffer_lint_with_diagnostic to buffer_lint 2024-05-21 20:16:39 +00:00
Xiretza
8004e6a379 Make early lints translatable 2024-05-21 20:16:39 +00:00
Xiretza
b7abf014ec Convert uses of BuiltinLintDiag::Normal to custom variants
This ensures all diagnostic messages are created at diagnostic emission
time, making them translatable.
2024-05-21 20:16:39 +00:00
Xiretza
41a20b4c56 Port DeprecatedMacro to diag structs 2024-05-21 20:16:39 +00:00
Xiretza
c227f35a9c Generate lint diagnostic message from BuiltinLintDiag
Translation of the lint message happens when the actual diagnostic is
created, not when the lint is buffered. Generating the message from
BuiltinLintDiag ensures that all required data to construct the message
is preserved in the LintBuffer, eventually allowing the messages to be
moved to fluent.

Remove the `msg` field from BufferedEarlyLint, it is either generated
from the data in the BuiltinLintDiag or stored inside
BuiltinLintDiag::Normal.
2024-05-21 20:16:39 +00:00
Xiretza
bac6b6248b Convert NAMED_ASM_LABELS lint to diag struct 2024-05-21 20:11:42 +00:00
bors
b92758a9ae Auto merge of #125219 - Urgau:check-cfg-cargo-config, r=fmease
Update `unexpected_cfgs` lint for Cargo new `check-cfg` config

This PR updates the diagnostics output of the `unexpected_cfgs` lint for Cargo new `check-cfg` config.

It's a simple and cost-less alternative to the build-script `cargo::rustc-check-cfg` instruction.

```toml
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(foo, values("bar"))'] }
```

This PR also adds a Cargo specific section regarding check-cfg and Cargo inside rustc's book (motivation is described inside the file, but mainly check-cfg is a rustc feature not a Cargo one, Cargo only enabled the feature, it does not own it; T-cargo even considers the `check-cfg` lint config to be an implementation detail).

This PR also updates the links to refer to that sub-page when using Cargo from rustc.

As well as updating the lint doc to refer to the check-cfg docs.

~**Not to be merged before https://github.com/rust-lang/cargo/pull/13913 reaches master!**~ (EDIT: merged in https://github.com/rust-lang/rust/pull/125237)

`@rustbot` label +F-check-cfg
r? `@fmease` *(feel free to roll)*
Fixes https://github.com/rust-lang/rust/issues/124800
cc `@epage` `@weihanglo`
2024-05-20 20:14:09 +00:00
Urgau
bc8e034c39 Link to the check-cfg doc section in the unexpected_cfgs lint doc 2024-05-19 20:15:01 +02:00
Waffle Lapkin
a02db8660c Make NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE into an FCW and report it ext macros 2024-05-18 00:08:52 +02:00
Waffle Lapkin
83acddc766 Remove fixme
(libs team decided not to add `absurd` to std)
2024-05-18 00:08:11 +02:00
mejrs
18d7411719 Add `on_unimplemented" typo suggestions 2024-05-15 00:49:33 +02:00
Jules Bertholet
9d92a7f355
Match ergonomics 2024: migration lint
Unfortunately, we can't always offer a machine-applicable suggestion when there are subpatterns from macro expansion.

Co-Authored-By: Guillaume Boisseau <Nadrieril@users.noreply.github.com>
2024-05-12 11:13:33 -04:00
Ralf Jung
cbd682beeb turn pointer_structural_match into a hard error 2024-05-03 15:56:59 +02:00
Ralf Jung
179a6a08b1 remove IndirectStructuralMatch lint, emit the usual hard error instead 2024-05-03 15:56:59 +02:00
Ross Smyth
6967d1c0fc Stabilize exclusive_range 2024-05-02 19:42:31 -04:00
Maybe Waffle
b63cb6fd81 Add an explanation about never type fallback 2024-05-02 03:47:32 +02:00
Maybe Waffle
aa0a916c81 Add a lint against never type fallback affecting unsafe code 2024-05-02 03:47:32 +02:00
bors
f705de5962 Auto merge of #117164 - fmease:orphan-norm, r=lcnr
Lazily normalize inside trait ref during orphan check & consider ty params in rigid alias types to be uncovered

Fixes #99554, fixes rust-lang/types-team#104.
Fixes #114061.

Supersedes #100555.

Tracking issue for the future compatibility lint: #124559.

r? lcnr
2024-04-30 20:51:46 +00:00
León Orell Valerian Liehr
951e902562
Normalize trait ref before orphan check & consider ty params in alias types to be uncovered 2024-04-30 21:54:54 +02:00
Matthias Krüger
784316eadc
Rollup merge of #124511 - nnethercote:rm-extern-crates, r=fee1-dead
Remove many `#[macro_use] extern crate foo` items

This requires the addition of more `use` items, which often make the code more verbose. But they also make the code easier to read, because `#[macro_use]` obscures where macros are defined.

r? `@fee1-dead`
2024-04-30 15:04:08 +02:00
blyxyas
d31b7db8e4 [Refactor] Rename Lint and LintGroup\'s is_loaded to is_externally_loaded 2024-04-29 15:57:09 +02:00
Nicholas Nethercote
4814fd0a4b Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
Jules Bertholet
e13911e6e8
Rename feature gate 2024-04-15 23:27:21 -04:00
Jules Bertholet
1b2e471b43
Fix typo
Co-authored-by: Guillaume Boisseau <Nadrieril@users.noreply.github.com>
2024-04-15 23:27:21 -04:00
Jules Bertholet
d5d700d5c6
Temporarily remove future compatibility label from migration lint
The lint is unstable, and the lint group `rust_2024_compatibility` must keep working on stable
2024-04-15 23:27:20 -04:00
Jules Bertholet
83f330fbd4
Migration lint
Rustfix remains TODO
2024-04-15 23:27:19 -04:00
Michael Goulet
a9e262a32d Split back out unused_lifetimes -> redundant_lifetimes 2024-04-09 12:17:34 -04:00
Michael Goulet
535151ed03 Add comments 2024-04-09 12:17:34 -04:00
Matthias Krüger
337be99bb6
Rollup merge of #120144 - petrochenkov:unty, r=davidtwco
privacy: Stabilize lint `unnameable_types`

This is the last piece of ["RFC #2145: Type privacy and private-in-public lints"](https://github.com/rust-lang/rust/issues/48054).

Having unstable lints is not very useful because you cannot even dogfood them in the compiler/stdlib in this case (https://github.com/rust-lang/rust/pull/113284).
The worst thing that may happen when a lint is removed are some `removed_lints` warnings, but I haven't heard anyone suggesting removing this specific lint.

This lint is allow-by-default and is supposed to be enabled explicitly.
Some false positives are expected, because sometimes unnameable types are a legitimate pattern.
This lint also have some unnecessary false positives, that can be fixed - see https://github.com/rust-lang/rust/issues/120146 and https://github.com/rust-lang/rust/issues/120149.

Closes https://github.com/rust-lang/rust/issues/48054.
2024-04-08 14:31:10 +02:00
joboet
989660c3e6
rename expose_addr to expose_provenance 2024-04-03 16:00:38 +02:00
Ralf Jung
67b9d7d184 rename ptr::from_exposed_addr -> ptr::with_exposed_provenance 2024-03-23 13:18:33 +01:00
León Orell Valerian Liehr
0995508562
Rollup merge of #121720 - tmandry:split-refining, r=compiler-errors
Split refining_impl_trait lint into _reachable, _internal variants

As discussed in https://github.com/rust-lang/rust/issues/119535#issuecomment-1909352040:

> We discussed this today in triage and developed a consensus to:
>
> * Add a separate lint against impls that refine a return type defined with RPITIT even when the trait is not crate public.
> * Place that in a lint group along with the analogous crate public lint.
> * Create an issue to solicit feedback on these lints (or perhaps two separate ones).
> * Have the warnings displayed with each lint reference this issue in a similar manner to how we do that today with the required `Self: '0'` bound on GATs.
> * Make a note to review this feedback on 2-3 release cycles.

This points users to https://github.com/rust-lang/rust/issues/121718 to leave feedback.
2024-03-16 23:28:47 +01:00
daxpedda
873a0f264e
Add wasm_c_abi future-incompat lint 2024-03-16 09:57:15 +01:00
Matthias Krüger
b200108bc5
Rollup merge of #122373 - surechen:fix_121331, r=petrochenkov
Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification`  and  `unused_imports`

fixes #121331

For an `item` that triggers lint unnecessary_qualification, if the `use item` which imports this item is also trigger unused import, fixing the two lints at the same time may lead to the problem that the `item` cannot be found.
This PR will avoid reporting lint unnecessary_qualification when conflict occurs.

r? ``@petrochenkov``
2024-03-14 20:00:20 +01:00
Matthias Krüger
c0fd2db49a
Rollup merge of #122482 - weiznich:fix/122446, r=compiler-errors
Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint

This was missed during stablisation of the `#[diagnostic]` attribute namespace.

Fixes #122446
2024-03-14 15:44:36 +01:00
Matthias Krüger
7a744af83e
Rollup merge of #121899 - shepmaster:dead-code-docs, r=wesleywiser
Document how removing a type's field can be bad and what to do instead

Related to #119645
2024-03-14 11:09:57 +01:00
Georg Semmler
25411113c1
Ungate the UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES lint
This was missed during stablisation of the `#[diagnostic]` attribute
namespace.

Fixes #122446
2024-03-14 10:49:28 +01:00
surechen
1a81a941ad fixes #121331 2024-03-14 09:54:42 +08:00
Vadim Petrochenkov
95ec17a793 privacy: Stabilize lint unnameable_types 2024-03-13 18:37:40 +03:00
Wesley Wiser
ae374cf04a Add produces as tidy requires 2024-03-13 10:32:42 -04:00
Felix S. Klock II
6ca46daded Added an "Explanation" header and expanded that section for the newly added lint. 2024-03-13 10:32:41 -04:00
Felix S. Klock II
a8549b4152 downgrade mutable-ptr-in-final-value from hard-error to future-incompat lint to address issue 121610. 2024-03-13 10:32:39 -04:00
Nadrieril
77f679430c Declare new lint 2024-03-09 01:13:42 +01:00
Jake Goulding
71080dd1d4 Document how removing a type's field can be bad and what to do instead
Related to #119645
2024-03-06 10:41:58 -05:00
Tyler Mandry
c121a26ab9 Split refining_impl_trait lint into _reachable, _internal variants 2024-03-05 16:19:16 -08:00
Nicholas Nethercote
7aa0eea19c Rename BuiltinLintDiagnostics as BuiltinLintDiag.
Not the dropping of the trailing `s` -- this type describes a single
diagnostic and its name should be singular.
2024-03-05 12:15:10 +11:00
Nicholas Nethercote
18715c98c6 Rename DiagnosticMessage as DiagMessage. 2024-03-05 12:14:49 +11:00
Matthias Krüger
8185c843f3
Rollup merge of #111505 - GuillaumeGomez:turn-invalid-doc-attr-into-err, r=rustdoc
Made `INVALID_DOC_ATTRIBUTES` lint deny by default

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

# Explanations

The `INVALID_DOC_ATTRIBUTES` lint was marked as "will become a hard error into the future" for quite some time so making it `deny` by default.

<del>Waiting on https://github.com/rust-lang/backtrace-rs/pull/524 for now.</del>
2024-03-01 22:38:45 +01:00
León Orell Valerian Liehr
cce81289e6
Detect empty leading where-clauses on type aliases 2024-02-29 17:20:04 +01:00
Guillaume Gomez
5ce15af6b1 Make invalid_doc_attributes deny by default 2024-02-29 14:34:58 +01:00
Nicholas Nethercote
899cb40809 Rename DiagnosticBuilder as Diag.
Much better!

Note that this involves renaming (and updating the value of)
`DIAGNOSTIC_BUILDER` in clippy.
2024-02-28 08:55:35 +11:00
Nicholas Nethercote
6588f5b749 Rename Diagnostic as DiagInner.
I started by changing it to `DiagData`, but that didn't feel right.
`DiagInner` felt much better.
2024-02-28 08:33:25 +11:00