about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/subst.rs
AgeCommit message (Collapse)AuthorLines
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1048/+0
2023-07-06Add a new trait to `Debug` things with an infcx availableBoxy-11/+0
2023-07-04enforce context effects in typeckDeadbeef-0/+5
2023-06-19change binders from tuple structs to named fieldslcnr-25/+28
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-1/+1
2023-05-28Add documentation on skip_binder on how to get &T from &EarlyBinder<T>Kyle Matsuda-0/+3
2023-05-28Make EarlyBinder's inner value private; and fix all of the resulting errorsKyle Matsuda-1/+1
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-0/+4
2023-04-27rename `needs_subst` to `has_param`Boxy-2/+2
2023-04-26Make some region folders a little stricter.Nicholas Nethercote-1/+7
Because certain regions cannot occur in them.
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-0/+12
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-22Rollup merge of #110622 - WaffleLapkin:hashtag#, r=compiler-errorsYuki Okushi-1/+1
Stable hash tag (discriminant) of `GenericArg` This is a continuation of my quest of removing `transmute` if generic args and types (#110496, #110599). r? `@compiler-errors`
2023-04-20Derive `HashStable` on `GenericArgKind` instead of implementing it by handMaybe Waffle-1/+1
2023-04-20add subst_identity_iter and subst_identity_iter_copied methods on ↵Kyle Matsuda-0/+12
EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
2023-04-20Rollup merge of #110599 - WaffleLapkin:bonk_tygenericarg_transmutes, ↵Matthias Krüger-13/+0
r=compiler-errors Remove an unused `&[Ty]` <-> `&[GenericArg]` Missed this one in #110496, oops. r? `@compiler-errors`
2023-04-20Remove an unused `&[Ty]` <-> `&[GenericArg]`Maybe Waffle-13/+0
2023-04-20Rollup merge of #110545 - WaffleLapkin:generic_arg_as_x, r=cjgillotMatthias Krüger-35/+35
Add `GenericArgKind::as_{type,const,region}` This allows to make code nicer in some cases
2023-04-19Move `GenericArgKind::as_{type,const,region}` to `GenericArg`Maybe Waffle-48/+32
2023-04-19Add `GenericArgKind::as_{type,const,region}`Maybe Waffle-23/+39
2023-04-18Don't transmute `&List<GenericArg>` <-> `&List<Ty>`Maybe Waffle-20/+10
2023-03-21IdentitySubsts::identity_for_item takes Into<DefId>Michael Goulet-2/+2
2023-02-24Rename many interner functions.Nicholas Nethercote-10/+10
(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-22Remove type-traversal trait aliasesAlan Egerton-26/+35
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-5/+3
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-5/+9
2023-02-13Make folding traits generic over the InternerAlan Egerton-5/+5
2023-02-13Make visiting traits generic over the InternerAlan Egerton-3/+3
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-9/+9
2023-01-26add EarlyBinder::no_bound_varsKyle Matsuda-0/+5
2023-01-17Rollup merge of #106953 - kylematsuda:early-binder-docs, r=jackh726Matthias Krüger-0/+19
Document `EarlyBinder::subst_identity` and `skip_binder` Finishing implementing #105779 will change several commonly used queries to return `EarlyBinder` by default. This PR adds documentation for two of the methods used to access data inside the `EarlyBinder`. I tried to summarize some of the [discussion from the issue](https://github.com/rust-lang/rust/issues/105779#issuecomment-1375512647) in writing this. r? `@lcnr`
2023-01-16document EarlyBinder::subst_identity and skip_binderKyle Matsuda-0/+19
2023-01-16Rollup merge of #106940 - oli-obk:tait_error, r=compiler-errorsMatthias Krüger-0/+7
Improve a TAIT error and add an error code plus documentation cc https://github.com/rust-lang/rust/issues/106858
2023-01-16Improve a TAIT error and add an error code plus documentationOli Scherer-0/+7
2023-01-15instantiate_own doesn't need to return a pair of vectorsMichael Goulet-0/+15
2023-01-14add EarlyBinder::subst_identity; impl ParameterizedOverTcx (needed for ↵Kyle Matsuda-0/+4
rustc_metadata) and Value for EarlyBinder
2023-01-12is_ty_infer -> is_ty_or_numeric_inferMichael Goulet-1/+1
2022-12-23Rollup merge of #105661 - lcnr:evaluate-new, r=compiler-errorsnils-0/+4
implement the skeleton of the updated trait solver cc ```@rust-lang/initiative-trait-system-refactor``` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ```@compiler-errors``` / ```@rust-lang/types``` :3
2022-12-22Rollup merge of #105960 - oli-obk:effect_cleanup, r=fee1-deadMatthias Krüger-1/+1
Various cleanups This PR pulls changes out of https://github.com/rust-lang/rust/pull/101900 that can land on master immediately r? ``@fee1-dead``
2022-12-20Some ICE debugging aidsOli Scherer-1/+1
2022-12-20use `track_caller` to show where the panic is actually fromOli Scherer-0/+4
2022-12-19implement the skeleton of the updated trait solverlcnr-0/+4
2022-12-16Rename ConstS to ConstDataOli Scherer-2/+2
2022-12-13Make InternalSubsts rust docs a bit clearerSantiago Pastorino-1/+1
2022-12-06Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiserMatthias Krüger-3/+4
Put all cached values into a central struct instead of just the stable hash cc `@nnethercote` this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields
2022-12-06Add GenericParamDef::to_error and InternalSubsts::extend_with_errorMichael Goulet-0/+16
2022-11-30Remove TySOli Scherer-2/+2
2022-11-30move WithCachedTypeInfo to rustc_type_irOli Scherer-1/+2
2022-11-30s/WithStableHash/WithCachedTypeInfo/Oli Scherer-3/+3
2022-11-26Auto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomezbors-0/+9
Rollup of 7 pull requests Successful merges: - #104786 (Use the power of adding helper function to simplify code w/ `Mutability`) - #104788 (Do not record unresolved const vars in generator interior) - #104909 (Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`) - #104921 (Remove unnecessary binder from `get_impl_future_output_ty`) - #104924 (jsondoclint: Accept trait alias is places where trait expected.) - #104928 (rustdoc: use flexbox CSS to align sidebar button instead of position) - #104943 (jsondoclint: Handle using enum variants and glob using enums.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-26Do not record unresolved const vars in generator interiorMichael Goulet-0/+9