Commit Graph

14 Commits

Author SHA1 Message Date
Michael Goulet
54b2b7d460 Make TraitEngines generic over error 2024-06-03 09:27:52 -04:00
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
Nicholas Nethercote
4814fd0a4b Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
Michael Goulet
34bce07e8e Remove TypeVariableOriginKind 2024-04-15 16:51:50 -04:00
Michael Goulet
a9dbf63087 Move trait into attr so it's greppable 2024-02-16 15:07:37 +00:00
Michael Goulet
9c25823bb4 Use extension trait derive 2024-02-16 15:07:37 +00:00
Michael Goulet
68c2f11240 Remove special-casing around aliaskind in new solver 2024-01-11 16:54:11 +00:00
Michael Goulet
132a2884ad Use alias-eq in structural normalization 2023-12-18 19:22:43 +00:00
lcnr
11d16c4082 update use of feature flags 2023-12-14 15:22:37 +01:00
lcnr
ffb4c08a81 implement and use NormalizesTo 2023-12-08 01:31:18 +01:00
lcnr
8024c69c29 HACK: avoid hang in structurally_normalize 2023-09-21 08:17:58 +02:00
Michael Goulet
fb9030d7dd Structurally normalize weak and inherent too 2023-08-07 19:05:59 +00:00
Michael Goulet
e0acff796a New trait solver is a property of inference context 2023-06-06 18:43:06 +00:00
Michael Goulet
4cfafb275e Structurally normalize in the new solver 2023-05-22 21:18:20 +00:00