diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-10 09:06:47 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-10 09:47:46 +1000 |
| commit | dbeae8da7882ea24ed2002deb3bfa06d50cad985 (patch) | |
| tree | 6a165cd6210f1fa4e7258932614be6ba48bfefc5 /tests/ui/patchable-function-entry/patchable-function-entry-flags.rs | |
| parent | 18fe295d33b64da533790b44f573c67bb4ba5245 (diff) | |
| download | rust-dbeae8da7882ea24ed2002deb3bfa06d50cad985.tar.gz rust-dbeae8da7882ea24ed2002deb3bfa06d50cad985.zip | |
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.
Diffstat (limited to 'tests/ui/patchable-function-entry/patchable-function-entry-flags.rs')
0 files changed, 0 insertions, 0 deletions
