about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/mod.rs
AgeCommit message (Collapse)AuthorLines
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-8/+7
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-29Support TLS access into dylibs on WindowsJohn Kåre Alsaker-0/+1
2023-03-27Some tracing/instrument cleanupsOli Scherer-21/+2
2023-03-27Add a builtin `FnPtr` traitlcnr-8/+8
2023-03-26transmute testMichael Goulet-2/+2
2023-03-23Refine error spans for const args in hir typeckMichael Goulet-0/+15
2023-03-23Rollup merge of #109462 - compiler-errors:alias-relate, r=BoxyUwU,lcnrMatthias Krüger-7/+23
Make alias-eq have a relation direction (and rename it to alias-relate) Emitting an "alias-eq" is too strict in some situations, since we don't always want strict equality between a projection and rigid ty. Adds a relation direction. * I could probably just reuse this [`RelationDir`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/enum.RelationDir.html) -- happy to uplift that struct into middle and use that instead, but I didn't feel compelled to... 🤷 * Some of the matching in `compute_alias_relate_goal` is a bit verbose -- I guess I could simplify it by using [`At::relate`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/at/struct.At.html#method.relate) and mapping the relation-dir to a variance. * Alternatively, I coulld simplify things by making more helper functions on `EvalCtxt` (e.g. `EvalCtxt::relate_with_direction(T, T)` that also does the nested goal registration). No preference. r? ```@lcnr``` cc ```@BoxyUwU``` though boxy can claim it if she wants NOTE: first commit is all the changes, the second is just renaming stuff
2023-03-23Remove AliasRelationDirection::SupertypeMichael Goulet-12/+0
2023-03-23Printing alias-relate goals correctlyMichael Goulet-0/+10
2023-03-23Rename AliasEq -> AliasRelateMichael Goulet-5/+5
2023-03-23Include relation direction in AliasEq predicateMichael Goulet-3/+21
2023-03-22`HirId` to `LocalDefId` cleanuplcnr-1/+1
2023-03-22Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errorsbors-0/+14
a general type system cleanup removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context. changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR. also removes some other small - and imo unnecessary - helpers. r? types
2023-03-21IdentitySubsts::identity_for_item takes Into<DefId>Michael Goulet-1/+1
2023-03-21Use local key in providersMichael Goulet-4/+10
2023-03-21remove some trait solver helperslcnr-0/+14
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
2023-03-20Update some names and commentsMichael Goulet-1/+3
2023-03-15ImplTraitPlaceholder -> is_impl_trait_in_traitSantiago Pastorino-0/+4
2023-03-15Make impl_trait_in_trait_container consider newly generated RPITITsSantiago Pastorino-4/+10
2023-03-15Rename impl_trait_in_trait_parent to impl_trait_in_trait_parent_fnSantiago Pastorino-1/+1
2023-03-13Don't opt_rpitit_info as a separate queryMichael Goulet-1/+14
2023-03-11Rollup merge of #108806 - cjgillot:query-lints, r=davidtwcoMatthias Krüger-3/+6
Querify register_tools and post-expansion early lints The 2 extra queries correspond to code that happen before and after macro expansion, and don't need the resolver to exist.
2023-03-09Emit alias-eq when equating numeric var and projectionMichael Goulet-1/+1
2023-03-06Querify early_lint_checks.Camille GILLOT-0/+5
2023-03-06Querify registered_tools.Camille GILLOT-3/+1
2023-03-05Auto merge of #108351 - petrochenkov:rmdit, r=cjgillotbors-17/+13
rustc_middle: Remove trait `DefIdTree` This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-03Match unmatched backticks in comments in compiler/est31-1/+1
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-17/+13
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-01Add opt_rpitit_info querySantiago Pastorino-0/+6
2023-02-28Descriptive error when users try to combine RPITIT/AFIT with specializationMichael Goulet-0/+28
2023-02-27Auto merge of #108487 - cjgillot:no-typeck-mir, r=oli-obkbors-1/+1
Avoid invoking typeck from borrowck This PR attempts to reduce direct dependencies between typeck and MIR-related queries. The goal is to have all the information transit either through THIR or through dedicated queries that avoid depending on the whole `TypeckResults`. In a first commit, we store the type information that MIR building requires into THIR. This avoids edges between mir_built and typeck. In the second and third commit, we wrap informations around closures (upvars, kind origin and user-provided signature) to avoid borrowck depending on typeck information. There should be a single remaining borrowck -> typeck edge in the good path, due to inline consts.
2023-02-27Rollup merge of #108363 - cjgillot:unused-crate, r=WaffleLapkinMatthias Krüger-4/+0
Move the unused extern crate check back to the resolver. It doesn't have anything to do in `rustc_hir_typeck`.
2023-02-26Wrap more into into closure_typeinfo query.Camille GILLOT-1/+1
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-22Use ty_error_with_guaranteed in many more placesMichael Goulet-2/+3
2023-02-22Remove some resolver outputs.Camille GILLOT-4/+0
2023-02-22Remove type-traversal trait aliasesAlan Egerton-14/+13
2023-02-20Run the resolver after TyCtxt constructionOli Scherer-2/+0
2023-02-19Auto merge of #108128 - clubby789:builtin-derived-attr, r=jackh726bors-3/+18
Properly check for builtin derived code Fixes #108122
2023-02-17Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstriebbors-1/+1
Remove `arena_cache` modifier from `associated_item` query & copy `ty::AssocItem` instead of passing by ref r? `@ghost`
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-1/+1
in metadata
2023-02-16Properly check for builtin derivesclubby789-3/+18
2023-02-15Copy `ty::AssocItem` all other the placeMaybe Waffle-1/+1
2023-02-15Auto merge of #108006 - cjgillot:def-impl, r=oli-obkbors-1/+1
Avoid accessing HIR when it can be avoided Experiment to see if it helps some incremental cases. Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged. r? `@ghost`
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-1/+1
2023-02-14add a `#[rustc_coinductive]` attributelcnr-4/+6
2023-02-14Auto merge of #107765 - petrochenkov:nomoclone, r=oli-obkbors-0/+1
rustc/rustdoc: Perform name resolver cleanups enabled by #94857 Unblocks https://github.com/rust-lang/rust/pull/105462. r? `@oli-obk`
2023-02-13Make folding traits generic over the InternerAlan Egerton-2/+2