about summary refs log tree commit diff
path: root/compiler/rustc_traits
AgeCommit message (Collapse)AuthorLines
2023-04-01fix clippy::iter_kv_mapMatthias Krüger-2/+1
2023-03-23Rename AliasEq -> AliasRelateMichael Goulet-7/+7
2023-02-24Add `mk_canonical_var_infos_from_iter`.Nicholas Nethercote-20/+17
It's missing, and is useful in two places.
2023-02-24Rename `mk_{ty,region}` as `mk_{ty,region}_from_kind`.Nicholas Nethercote-1/+1
To discourage accidental use -- there are more specific `mk_*` functions for all `Ty` and `Region` kinds.
2023-02-24Rename many interner functions.Nicholas Nethercote-3/+5
(This is a large commit. The changes to `compiler/rustc_middle/src/ty/context.rs` are the most important ones.) The current naming scheme is a mess, with a mix of `_intern_`, `intern_` and `mk_` prefixes, with little consistency. In particular, in many cases it's easy to use an iterator interner when a (preferable) slice interner is available. The guiding principles of the new naming system: - No `_intern_` prefixes. - The `intern_` prefix is for internal operations. - The `mk_` prefix is for external operations. - For cases where there is a slice interner and an iterator interner, the former is `mk_foo` and the latter is `mk_foo_from_iter`. Also, `slice_interners!` and `direct_interners!` can now be `pub` or non-`pub`, which helps enforce the internal/external operations division. It's not perfect, but I think it's a clear improvement. The following lists show everything that was renamed. slice_interners - const_list - mk_const_list -> mk_const_list_from_iter - intern_const_list -> mk_const_list - substs - mk_substs -> mk_substs_from_iter - intern_substs -> mk_substs - check_substs -> check_and_mk_substs (this is a weird one) - canonical_var_infos - intern_canonical_var_infos -> mk_canonical_var_infos - poly_existential_predicates - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter - intern_poly_existential_predicates -> mk_poly_existential_predicates - _intern_poly_existential_predicates -> intern_poly_existential_predicates - predicates - mk_predicates -> mk_predicates_from_iter - intern_predicates -> mk_predicates - _intern_predicates -> intern_predicates - projs - intern_projs -> mk_projs - place_elems - mk_place_elems -> mk_place_elems_from_iter - intern_place_elems -> mk_place_elems - bound_variable_kinds - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter - intern_bound_variable_kinds -> mk_bound_variable_kinds direct_interners - region - intern_region (unchanged) - const - mk_const_internal -> intern_const - const_allocation - intern_const_alloc -> mk_const_alloc - layout - intern_layout -> mk_layout - adt_def - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid) - alloc_adt_def(!) -> mk_adt_def - external_constraints - intern_external_constraints -> mk_external_constraints Other - type_list - mk_type_list -> mk_type_list_from_iter - intern_type_list -> mk_type_list - tup - mk_tup -> mk_tup_from_iter - intern_tup -> mk_tup
2023-02-22Rename ty_error_with_guaranteed to ty_error, ty_error to ty_error_miscMichael Goulet-1/+1
2023-02-22Remove type-traversal trait aliasesAlan Egerton-14/+19
2023-02-17Add `Clause::ConstArgHasType` variantBoxy-0/+8
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-6/+6
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-3/+3
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-11/+11
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-4/+4
2023-02-13Make folding traits generic over the InternerAlan Egerton-4/+4
2023-02-13Make visiting traits generic over the InternerAlan Egerton-2/+2
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-4/+5
2023-02-13Reduce direct `mk_ty` usage.Nicholas Nethercote-17/+13
We use more specific `mk_*` functions in most places, might as well use them as much as possible.
2023-02-11Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnrbors-1/+8
Implement `deferred_projection_equality` for erica solver Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-10add `AliasEq` to `PredicateKind`Boxy-1/+8
2023-02-10Auto merge of #107652 - estebank:re_error, r=oli-obkbors-0/+3
Introduce `ReError` CC #69314 r? `@nagisa`
2023-02-09Update implied_outlives_bounds to properly register implied bounds behind ↵Jack Huey-36/+50
normalization
2023-02-09Cleanup free_region_relations a bitJack Huey-0/+1
2023-02-09Change to `ReError(ErrorGuaranteed)`Esteban Küber-1/+1
2023-02-09Introduce `ReError`Esteban Küber-0/+3
CC #69314
2023-02-06remove unused importsklensy-1/+0
2023-01-30Track bound types like bound regionsMichael Goulet-24/+24
2023-01-29Auto merge of #106253 - nbdd0121:upcast, r=compiler-errorsbors-1/+1
Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable` Fix #106247 To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query). cc `@dtolnay` r? `@compiler-errors`
2023-01-28Auto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnrbors-10/+8
Intern `CanonicalVarValues` So that they are copy :sparkles:
2023-01-28Rename `is_object_safe` to `check_is_object_safe` to hint side effectsGary Guo-1/+1
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-1/+3
2023-01-27Separate trait selection from ambiguity reporting.Camille GILLOT-1/+1
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-1/+1
EarlyBinder to fn_sig in metadata
2023-01-26Intern CanonicalVarValuesMichael Goulet-10/+8
2023-01-23fix: use LocalDefId instead of HirId in trait resVincenzo Palazzo-7/+5
use LocalDefId instead of HirId in trait resolution to simplify the obligation clause resolution Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-19even more unify Projection/Opaque in outlives codeAli MJ Al-Nasrawy-4/+2
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-1/+1
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2023-01-17Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorinoMatthias Krüger-3/+2
Unify `Opaque`/`Projection` handling in region outlives code They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias` r? types
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-8/+7
2023-01-15Make InstantiatedPredicates impl IntoIteratorMichael Goulet-4/+1
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-4/+3
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-1/+2
2023-01-13Unify Opaque/Projection handling in region outlives codeMichael Goulet-3/+2
2023-01-10Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obkYuki Okushi-1/+1
No need to take opaques in `check_type_bounds` `InferCtxt` already has its defining use anchor set to err r? ``@oli-obk``
2023-01-09Assert defining anchor is set in take_opaque_typesMichael Goulet-1/+1
2023-01-07make ascribe_user_type a TypeOpAli MJ Al-Nasrawy-11/+42
Projection types in user annotations may contain inference variables. This makes the normalization depend on the unification with the actual type and thus requires a separate TypeOp to track the obligations. Otherwise simply calling `TypeChecker::normalize` would ICE with "unexpected ambiguity"
2023-01-07don't normalize in astconvAli MJ Al-Nasrawy-0/+1
We delay projection normalization to further stages in order to register user type annotations before normalization in HIR typeck. There are two consumers of astconv: ItemCtxt and FnCtxt. The former already expects unnormalized types from astconv, see its AstConv trait impl. The latter needs `RawTy` for a cleaner interface. Unfortunately astconv still needs the normalization machinery in order to resolve enum variants that have projections in the self type, e.g. `<<T as Trait>::Assoc>::StructVariant {}`. This is why `AstConv::normalize_ty_2` is necessary.
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-3/+3
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-14/+14
2022-12-13Remove chalk lowering for AliasTyMichael Goulet-11/+10