Commit Graph

345 Commits

Author SHA1 Message Date
mu001999
196db98ee0 Emit delayed bug when comparing incompatible constructors 2026-09-07 19:51:32 +08:00
bors
da47efd272 Auto merge of #159541 - camsteffen:inhabited-variant-query, r=Nadrieril
Use query for Variant InhabitedPredicate



It looks like there may be some benefit from caching.
2026-09-06 13:21:21 +00:00
cyrgani
9caab2652e remove box_patterns feature 2026-08-25 07:50:03 +00:00
Waffle Lapkin
f34322b0dc remove #![feature(never_type)] from the compiler
The reason `rustc_ast_ir` and `rustc_pattern_analysis` have nested
`cfg_attr`s is so that they don't mention `cfg(bootstrap)` when nightly
or rustc cargo feature turned on. If you don't do it like that, they stop
compiling on stable (or rather, they emit unexpected cfg warnings...).
2026-08-24 19:04:00 +02:00
mejrs
9a4a803f75 change rustc_lint_deps dep to rustc only 2026-08-20 23:11:38 +02:00
mejrs
7cd9c920cd rustc_session; remove rustc_lint_defs rex-exports 2026-08-20 23:02:49 +02:00
Makai
99a97efa82 use with_types_for_suggestion! in write_struct_like() 2026-08-13 16:49:48 +08:00
Chris Denton
4641990929 Remove ensure_sufficient_stack 2026-08-09 19:58:29 +00:00
Ralf Jung
6daa152ce8 bump tracing-tree 2026-08-03 14:50:11 +02:00
mejrs
c955c638ca Remove various superfluous lint attributes 2026-07-29 13:01:52 +02:00
Cameron Steffen
6eff1b1633 Use query for Variant InhabitedPredicate 2026-07-22 07:17:04 -05:00
Cameron Steffen
3c0923a48d Use ModId more 2026-07-14 08:23:57 -05:00
Adwin White
3dbe96a5a1 add IsRigid marker to TyKind::Alias and constants 2026-06-25 17:12:10 +08:00
Guillaume Gomez
d91a3748ce Rename rustc_pattern_analysis/src/errors.rs into rustc_pattern_analysis/src/diagnostics.rs 2026-06-15 12:44:12 +02:00
Nicholas Nethercote
530a73f17e Prevent invalid LevelSpec values
`LevelSpec` has two related fields, `level` and `lint_id`. This commit
makes the fields private (and introduces getters) to ensure they are set
together using only valid combinations.

The commit also introduces `is_allow` and `is_expect` methods because
those are useful.
2026-05-14 16:28:50 +10:00
Nicholas Nethercote
ccfac5469a Rename LevelAndSource
It is misnamed, given that it has three fields: `level`, `lint_id`, and
`src`. (Presumably the `lint_id` was added later.)

This commit renames it as `LevelSpec`. (I also considered `LevelInfo`
but that's very generic. `Spec` has pre-existing uses in
`LintLevelsProvider::current_specs` and `LintSet::specs` and
`ShallowLintLevelMap::specs`.)

Related things renamed as well:
- `level` -> `level_spec` (where appropriate)
- `lint_levels` -> `lint_level_specs`
- `get_lint_level` -> `get_lint_level_spec`
- `level_and_source` -> `level_spec`
- `CodegenLintLevels` -> `CodegenLintLevelSpecs`
- `raw_lint_id_level` -> `raw_lint_level_spec`
- `lint_level_at_node` -> `lint_level_spec_at_node`
- `reveal_actual_level` -> `reveal_actual_level_spec`
- `probe_for_lint_level` -> `probe_for_lint_level_spec`

This clears up a lot of `Level` vs. `LevelSpec` ambiguity. E.g. no more
`level.level` expressions.
2026-05-14 13:20:57 +10:00
lcnr
3fb166fb6f tiny PR 2026-05-12 21:58:50 +02:00
Nicholas Nethercote
e92ca90902 Remove unused Captures trait. 2026-05-01 13:32:54 +10:00
Adwin White
6279106e72 fix all errors 2026-04-20 00:18:28 +08:00
Nicholas Nethercote
9b64d52d78 Reduce diagnostic type visibilities.
Most diagnostic types are only used within their own crate, and so have
a `pub(crate)` visibility. We have some diagnostic types that are
unnecessarily `pub`. This is bad because (a) information hiding, and (b)
if a `pub(crate)` type becomes unused the compiler will warn but it
won't warn for a `pub` type.

This commit eliminates unnecessary `pub` visibilities for some
diagnostic types, and also some related things due to knock-on effects.
(I found these types with some ad hoc use of `grep`.)
2026-04-16 07:42:17 +10:00
WilliamTakeshi
a133bb8f27 replace @ ty::AliasTy matches with just args 2026-04-11 18:00:32 +00:00
Jonathan Brouwer
5ef7a3d73f Rollup merge of #154961 - mejrs:yeet_the_fixme, r=Nadrieril
Use derived impl for `GappedRange` subdiagnostic
2026-04-08 14:22:07 +02:00
Jonathan Brouwer
e1b15f4397 Rollup merge of #154934 - ChayimFriedman2:export-pat-slice, r=Nadrieril
Add getters for `rustc_pattern_analysis::constructor::Slice` fields

rust-analyzer needs that.

r? @Nadrieril
2026-04-08 14:22:05 +02:00
mejrs
975761c64d Use derived impl for GappedRange subdiagnostic 2026-04-07 19:02:37 +02:00
Chayim Refael Friedman
05320a26ed Add getters for rustc_pattern_analysis::constructor::Slice fields
rust-analyzer needs that.
2026-04-07 11:27:49 +03:00
Waffle Lapkin
0f767084b8 ty::Alias refactor: fixup all the compiler code 2026-04-07 10:08:12 +02:00
human9000
8a57f3d844 Introduce guard pattern to THIR
Co-authored-by: Max Niederman <max@maxniederman.com>
2026-03-17 10:19:23 +05:00
Guillaume Gomez
e805d8c961 Remove mentions of LintDiagnostic 2026-03-04 15:16:52 +01:00
Guillaume Gomez
ee855c02af Migrate rustc_pattern_analysis lint to Diagnostic 2026-03-04 11:32:19 +01:00
Guillaume Gomez
2bb3b01af2 Replace TyCtxt::emit_node_span_lint with emit_diag_node_span_lint 2026-02-24 20:34:22 +01:00
Guillaume Gomez
c53fbcd726 Migrate rustc_pattern_analysis to use TyCtxt::emit_diag_node_span_lint 2026-02-24 20:12:42 +01:00
Jonathan Brouwer
65d982abd8 Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann
Remove unused features

Detected by https://github.com/rust-lang/rust/pull/152164.

~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
2026-02-13 13:34:58 +01:00
mu001999
a07f837491 Remove unused features in compiler 2026-02-13 09:25:39 +08:00
Jonathan Brouwer
ab4891ce74 Convert some impl Subdiagnostics to derives 2026-02-11 19:45:04 +01:00
Jonathan Brouwer
67c6cd99b7 Convert to inline diagnostics in rustc_pattern_analysis 2026-02-05 12:13:25 +01:00
Frank King
4ae5b43b0f refactor: remove Ty::pinned_ref in favor of Ty::maybe_pinned_ref
Also returns the `Region` of the reference type.
2026-01-30 14:22:41 +08:00
Zalathar
566c23de41 THIR patterns: Explicitly distinguish &pin from plain &/&mut 2026-01-20 13:41:32 +11:00
Jonathan Brouwer
0ee7d96253 Remove all allows for diagnostic_outside_of_impl and untranslatable_diagnostic throughout the codebase
This PR was mostly made by search&replacing
2026-01-19 17:39:49 +01:00
Zalathar
066eb6d2ea THIR patterns: Always use type str for string-constant-value nodes 2026-01-16 12:17:48 +11:00
Zalathar
8516c64115 Replace AscribeUserType and ExpandedConstant with per-node data 2026-01-09 16:46:08 +11:00
Sekar-C-Mca
65c10702bd Fix typo in pattern usefulness documentation
Line 171 introduced `pt_1, .., pt_n` and `qt` as variable names, but
line 172 incorrectly used `tp_1, .., tp_n, tq`. This commit fixes the
inconsistency to use the correct variable names throughout.
2026-01-03 22:46:09 +05:30
Boxy Uwu
6722805cdc Make ValTree recurse through ty::Const 2025-12-23 13:54:59 +00:00
Marijn Schouten
5d8a096afe change non-canonical clone impl to {*self}, fix some doc comments 2025-12-20 13:46:22 +00:00
Shoyu Vanilla
dae003b04b fix: Do not ICE when missing match arm with ill-formed subty is met 2025-11-13 01:36:35 +09:00
Frank King
5ef48ed448 Implement &pin patterns and ref pin bindings 2025-11-10 09:57:08 +08:00
lcnr
ad20e5c468 split definition and use site hidden tys 2025-10-31 14:48:43 +01:00
Boxy Uwu
4d41177513 Rename various "concrete opaque type" terminology to say "hidden type" 2025-09-27 22:58:02 +01:00
León Orell Valerian Liehr
26f3337d4e Remove DynKind 2025-09-17 04:46:46 +02:00
Nicholas Nethercote
301655eafe Revert introduction of [workspace.dependencies].
This was done in #145740 and #145947. It is causing problems for people
using r-a on anything that uses the rustc-dev rustup package, e.g. Miri,
clippy.

This repository has lots of submodules and subtrees and various
different projects are carved out of pieces of it. It seems like
`[workspace.dependencies]` will just be more trouble than it's worth.
2025-09-02 19:12:54 +10:00
Nicholas Nethercote
2b26476ccd Add rustc-hash to [workspace.dependencies]. 2025-08-28 20:11:43 +10:00