rust/compiler/rustc_infer/src/infer
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
..
canonical Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
error_reporting Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
lexical_region_resolve Stop sorting via DefIds in region resolution 2024-03-21 16:36:17 +00:00
opaque_types Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
outlives Actually create ranged int types in the type system. 2024-04-08 12:02:19 +00:00
region_constraints Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
relate Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
snapshot Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
at.rs Rollup merge of #123969 - oli-obk:define_opaque_types6, r=compiler-errors 2024-04-16 17:54:43 +02:00
free_regions.rs review + fix CI 2023-11-14 13:41:28 +00:00
freshen.rs freshen: resolve root vars 2024-02-22 17:29:26 +01:00
mod.rs Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
projection.rs Use fewer origins when creating type variables. 2024-05-10 09:47:46 +10:00
resolve.rs Simplify shallow resolver to just fold ty/consts 2024-04-15 18:09:16 -04:00
type_variable.rs nits 2024-04-15 16:52:51 -04:00