rust/clippy_utils/src
Nicholas Nethercote dbeae8da78 Use fewer origins when creating type variables.
`InferCtxt::next_{ty,const}_var*` all take an origin, but the
`param_def_id` is almost always `None`. This commit changes them to just
take a `Span` and build the origin within the method, and adds new
methods for the rare cases where `param_def_id` might not be `None`.
This avoids a lot of tedious origin building.

Specifically:
- next_ty_var{,_id_in_universe,_in_universe}: now take `Span` instead of
  `TypeVariableOrigin`
- next_ty_var_with_origin: added

- next_const_var{,_in_universe}: takes Span instead of ConstVariableOrigin
- next_const_var_with_origin: added

- next_region_var, next_region_var_in_universe: these are unchanged,
  still take RegionVariableOrigin

The API inconsistency (ty/const vs region) seems worth it for the
large conciseness improvements.
2024-05-10 09:47:46 +10:00
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
mir Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
ty/type_certainty Merge commit 'ca3b393750' into clippy-subtree-update 2024-04-18 17:48:52 +02:00
ast_utils.rs Rollup merge of #123344 - pietroalbini:pa-unused-imports, r=Nilstrieb 2024-05-08 23:33:24 +02:00
attrs.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
check_proc_macro.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
comparisons.rs Merge commit 'd9c24d1b1e' into clippyup 2023-07-17 10:22:32 +02:00
consts.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
diagnostics.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
eager_or_lazy.rs Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
higher.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
hir_utils.rs put hir::AnonConst on the hir arena 2024-04-26 12:57:02 +00:00
lib.rs Merge commit '20b085d500' into clippy-subtree-update 2024-05-02 17:26:44 +02:00
macros.rs Merge commit '20b085d500' into clippy-subtree-update 2024-05-02 17:26:44 +02:00
numeric_literal.rs Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
paths.rs Merge commit '20b085d500' into clippy-subtree-update 2024-05-02 17:26:44 +02:00
ptr.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
qualify_min_const_fn.rs rename expose_addr to expose_provenance 2024-04-03 16:00:38 +02:00
source.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
str_utils.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
sugg.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
usage.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
visitors.rs Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00