summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/instance.rs
AgeCommit message (Collapse)AuthorLines
2024-03-09Rollup merge of #122237 - fee1-dead-contrib:rmord, r=compiler-errorsMatthias Krüger-1/+1
Remove `Ord` from `ClosureKind` Using `Ord` to accomplish a meaning of subset relationship can be hard to read. The existing uses for that are easily replaced with a `match`, and in my opinion, more readable without needing to resorting to comments to explain the intention. cc `@compiler-errors`
2024-03-09Remove `Ord` from `ClosureKind`Deadbeef-1/+1
Using `Ord` to accomplish a meaning of subset relationship can be hard to read. The existing uses for that are easily replaced with a `match`, and in my opinion, more readable without needing to resorting to comments to explain the intention.
2024-03-07sync (try_)instantiate_mir_and_normalize_erasing_regions implementationklensy-2/+4
try_instantiate_mir_and_normalize_erasing_regions was changed in https://github.com/rust-lang/rust/commit/dbc2cc8717dd8c8006595d9e9c91ad472109165a, but not instantiate_mir_and_normalize_erasing_regions
2024-02-12Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obkMatthias Krüger-8/+8
Dejargonize `subst` In favor of #110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
2024-02-12Dejargnonize substShoyu Vanilla-8/+8
2024-02-11is_closure_likeMichael Goulet-5/+2
2024-02-07Record coroutine kind in genericsMichael Goulet-1/+8
2024-02-06Fix drop shim for AsyncFnOnce closure, AsyncFnMut shim for AsyncFn closureMichael Goulet-13/+13
2024-02-06More comments, final tweaksMichael Goulet-0/+7
2024-02-06Bless tests, add commentsMichael Goulet-1/+4
2024-02-06Construct body for by-move coroutine closure outputMichael Goulet-1/+20
2024-02-06Build a shim to call async closures with different AsyncFn trait kindsMichael Goulet-1/+22
2024-01-23Rollup merge of #120139 - compiler-errors:fnonce-shim, r=BoxyUwULeón Orell Valerian Liehr-10/+8
Do not normalize closure signature when building `FnOnce` shim It is not necessary to normalize the closure signature when building an `FnOnce` shim for an `Fn`/`FnMut` closure. That closure shim is just calling `FnMut::call_mut(&mut self)` anyways. It's also somewhat sketchy that we were ever doing this to begin with, since we're normalizing with a `ParamEnv::reveal_all()` param-env, which is definitely not right with possibly polymorphic substs. This cuts out a tiny bit of unnecessary work in `Instance::resolve` and simplifies the signature because now we can unconditionally return an `Instance`.
2024-01-22Do not normalize closure signature when building FnOnce shimMichael Goulet-10/+8
2024-01-19Consolidate logic around resolving built-in coroutine trait implsMichael Goulet-0/+50
2024-01-05fix OOM when `ty::Instance` is used in query descriptionLukas Markeffsky-4/+8
2023-12-30Use the right type for upvarsMichael Goulet-6/+4
2023-12-30is_coroutine -> is_coroutine_or_closureMichael Goulet-3/+6
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-2/+2
2023-12-03rustc: Harmonize `DefKind` and `DefPathData`Vadim Petrochenkov-1/+1
`DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`. `DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`. It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` could be a better solution, but that would be a much more invasive change. Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values. `DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
2023-10-21Make `ty::print::Printer` take `&mut self` instead of `self`Nilstrieb-3/+3
This simplifies the code by removing all the `self` assignments and makes the flow of data clearer - always into the printer. Especially in v0 mangling, which already used `&mut self` in some places, it gets a lot more uniform.
2023-10-20s/generator/coroutine/Oli Scherer-6/+6
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-5/+4
2023-10-02`skip_binder` to `instantiate_identity`lcnr-2/+7
2023-09-26subst -> instantiatelcnr-6/+6
2023-09-18Remove unused `Lift` derives.Nicholas Nethercote-0/+3
I found these by commenting out all `Lift` derives and then adding back the ones that were necessary to successfully compile.
2023-09-14treat host effect params as erased generics in codegenDeadbeef-1/+2
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-9/+7
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-81/+81
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-3/+3
2023-07-05Winnow specializing implsMichael Goulet-2/+2
2023-06-05cleanup some skip_binder -> subst_identityKyle Matsuda-1/+1
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-1/+1
2023-05-06changes from review: add FIXME to clippy and change subst_identity to ↵Kyle Matsuda-3/+3
skip_binder in mir subst methods
2023-05-06make subst_mir take EarlyBinderKyle Matsuda-3/+4
2023-05-06use EarlyBinder in tcx.(try_)subst_mir_and_normalize_erasing_regionsKyle Matsuda-6/+6
2023-05-06make (try_)subst_and_normalize_erasing_regions take EarlyBinderKyle Matsuda-3/+3
2023-05-06More robust debug assertions for `Instance::resolve` on built-in traits with ↵Michael Goulet-1/+1
custom items
2023-04-20Remove WithOptconstParam.Camille GILLOT-74/+28
2023-03-29Support TLS access into dylibs on WindowsJohn Kåre Alsaker-1/+16
2023-03-27Add a builtin `FnPtr` traitlcnr-3/+15
2023-03-21Use local key in providersMichael Goulet-1/+5
2023-03-18Implement FixedSizeEncoding for UnusedGenericParams.Camille GILLOT-0/+14
2023-02-24Rename many interner functions.Nicholas Nethercote-1/+1
(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-5/+5
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-2/+2
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-3/+3
2023-02-16Replace some `then`s with some `then_some`sMaybe Waffle-1/+1
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-1/+1