rust/compiler/rustc_hir_analysis/src
Nicholas Nethercote fe843feaab 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
..
check Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
coherence shallow resolve in orphan check 2024-05-02 15:44:05 +00:00
collect Avoid some def_span query calls 2024-04-29 09:48:19 +00:00
errors Explicitly mention Self 2024-04-20 11:39:43 -04:00
hir_ty_lowering Inline & delete Ty::new_unit, since it's just a field access 2024-05-02 17:49:23 +02:00
impl_wf_check Use expand_weak_alias_tys when collecting constrained generics params in impls 2024-02-20 17:31:59 +01:00
outlives Use FxIndexMap instead of BTreeMap to avoid sorting DefIds 2024-03-27 14:02:15 +00:00
structured_errors Suggest _ for missing generic arguments in turbofish 2024-03-17 17:34:17 +00:00
variance Don't leak unnameable types in -> _ recover 2024-04-14 11:43:05 -04:00
autoderef.rs Take ocx by move for pending obligations 2024-05-02 22:03:01 -04:00
bounds.rs Make Bounds.clauses private 2024-05-04 10:20:39 +08:00
check_unused.rs Rename TyCtxt::struct_span_lint_hir as TyCtxt::node_span_lint. 2024-01-23 08:09:01 +11:00
collect.rs Auto merge of #124401 - oli-obk:some_hir_cleanups, r=cjgillot 2024-05-04 00:32:27 +00:00
constrained_generic_params.rs Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
errors.rs Auto merge of #124356 - fmease:fewer-magic-numbers-in-names, r=lcnr 2024-05-01 00:04:36 +00:00
hir_wf_check.rs Do not ICE on AnonConsts in diagnostic_hir_wf_check 2024-04-22 10:31:32 +05:30
impl_wf_check.rs Merge check_mod_impl_wf and check_mod_type_wf 2024-03-07 06:27:09 +00:00
lib.rs Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
structured_errors.rs Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00