about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/infer/relate
AgeCommit message (Collapse)AuthorLines
2025-09-08Auto merge of #140375 - lcnr:subrelations-infcx, r=BoxyUwUbors-0/+4
eagerly compute `sub_unification_table` again Previously called `sub_relations`. We still only using them for diagnostics right now. This mostly reverts rust-lang/rust#119989. Necessary for type inference guidance due to not-yet defined opaque types, cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/182. We could use them for cycle detection in generalization and it seems desirable to do so in the future. However, this is unsound with the old trait solver as its cache does not track these `sub_unification_table` in any way. We now properly track the `sub_unification_table` when canonicalizing so using them in the new solver is totally sound and the performance impact is far more manageable than I thought back in rust-lang/rust#119989. r? `@compiler-errors`
2025-09-08reviewlcnr-1/+1
2025-09-08eagerly compute `sub_relations` againlcnr-0/+4
2025-09-08Move `rustc_middle::MaxUniverse` to `rustc_infer`.Nicholas Nethercote-2/+41
Because `rust_infer` is the only crate that uses it.
2025-08-03Auto merge of #144677 - nnethercote:bound-const-handling, r=lcnrbors-2/+2
Improve bound const handling A few changes to make const handling more similar to type handling. r? `@compiler-errors` -errors
2025-07-31Make const bound handling more like types/regions.Nicholas Nethercote-2/+2
Currently there is `Ty` and `BoundTy`, and `Region` and `BoundRegion`, and `Const` and... `BoundVar`. An annoying inconsistency. This commit repurposes the existing `BoundConst`, which was barely used, so it's the partner to `Const`. Unlike `BoundTy`/`BoundRegion` it lacks a `kind` field but it's still nice to have because it makes the const code more similar to the ty/region code everywhere. The commit also removes `impl From<BoundVar> for BoundTy`, which has a single use and doesn't seem worth it. These changes fix the "FIXME: We really should have a separate `BoundConst` for consts".
2025-07-31Move `TermVid` out of `rustc_middle`.Nicholas Nethercote-10/+26
It's only used in `rustc_infer`.
2025-06-25rename RegionVariableOrigin::MiscVariable to RegionVariableOrigin::MiscMichael Goulet-4/+3
2025-05-27Rename unpack to kindMichael Goulet-1/+1
2025-05-02Use less rustc_type_ir in the compiler codebaseRomain Perier-5/+3
This commit does the following: - Replaces use of rustc_type_ir by rustc_middle in rustc_infer. - The DelayedMap type is exposed by rustc_middle so everything can be accessed through rustc_middle in a coherent manner. - API-layer traits, like InferCtxtLike, Interner or inherent::* must be accessed via rustc_type_ir, not rustc_middle::ty. For this reason these are not reexported by rustc_middle::ty. - Replaces use of ty::Interner by rustc_type_ir::Interner in rustc_trait_selection
2025-04-24Remove `weak` alias terminologyBoxy-1/+1
2025-04-08clean code: remove Deref<Target=RegionKind> impl for Region and use `.kind()`xizheyin-1/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-15Fold visit into tyMichael Goulet-5/+3
2025-03-15Squash fold into tyMichael Goulet-2/+1
2025-02-26Use Binder<Vec<T>> instead of Vec<Binder<T>> in new solverMichael Goulet-2/+4
2025-02-08Rustfmtbjorn3-12/+12
2025-02-02Move `unify_key` module.Nicholas Nethercote-1/+1
From `rustc_middle::infer` to `rustc_infer::infer`. Because everything in it is only used within `rustc_infer`, and no longer needs to be `pub`. Plus it's always good to make the huge `rustc_middle` crate smaller.
2025-01-22Remove `Copy` bound from `enter_forall`Boxy-3/+3
2024-11-23no more Reveal :(lcnr-8/+2
2024-10-29TypingMode :thinking:lcnr-2/+9
2024-10-24Remove associated type based effects logicMichael Goulet-1/+0
2024-10-12Swap Vec<PredicateObligation> to type aliasGnomedDev-8/+8
2024-10-10Make super combine into fnsMichael Goulet-8/+8
2024-10-10Use SolverRelating in favor of TypeRelating in the old solver where possibleMichael Goulet-3/+2
2024-10-10Remove unnecessary StructurallyRelateAliases from CombineFields/TypeRelatingMichael Goulet-4/+1
2024-10-10Use SolverRelating in new solverMichael Goulet-1/+0
2024-10-10Uplift super_combineMichael Goulet-250/+5
2024-10-10Move ty::Error branch into super_combine_tysMichael Goulet-5/+5
2024-10-08Improve formatting of some comments.Nicholas Nethercote-2/+4
I.e. fixing comments lines that are too long or too short.
2024-10-07Remove unnecessary DefineOpaqueTypes from lubMichael Goulet-11/+7
2024-10-07Inline CombineFieldsMichael Goulet-173/+129
2024-10-07Reduce visibilities some more.Nicholas Nethercote-11/+11
It helps people reading the code understand how widely things are used.
2024-10-04Auto merge of #131191 - nnethercote:lattice_op, r=lcnrbors-403/+231
Merge `glb` and `lub` modules Tons of code is duplicated across them, and it's easy to factor that out. r? `@lcnr`
2024-10-04Remove `LatticeDir` trait.Nicholas Nethercote-104/+69
It's no longer necessary now that the `glb` and `lub` modules have been merged.
2024-10-04Merge `rustc_infer::infer::relate::{glb,lub}`.Nicholas Nethercote-333/+196
Most of the code in these two modules is duplicated in the other module. This commit eliminates the duplication by replacing them with a new module `lattice_op`. The new `LatticeOpKind` enum is used to distinguish between glb and lub in the few places where the behaviour differs.
2024-10-02reviewlcnr-3/+5
2024-10-01add caches to multiple type folderslcnr-2/+46
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-19/+19
2024-09-10generalize: track relevant info in cache keylcnr-9/+9
2024-09-02chore: Fix typos in 'compiler' (batch 1)Alexander Cyon-2/+2
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_infer`.Nicholas Nethercote-0/+7
2024-08-27Add `warn(unreachable_pub)` to `rustc_infer`.Nicholas Nethercote-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-36/+34
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-18Remove tag field from relationsMichael Goulet-25/+11
2024-07-17Fix relationsMichael Goulet-15/+15
2024-07-06Uplift PredicateEmittingRelation firstMichael Goulet-39/+15
2024-06-15Rollup merge of #126354 - compiler-errors:variance, r=lcnrMatthias Krüger-26/+16
Use `Variance` glob imported variants everywhere Fully commit to using the globbed variance. Could be convinced the other way, and change this PR to not use the globbed variants anywhere, but I'd rather we do one or the other. r? lcnr
2024-06-12Use Variance glob import everywhereMichael Goulet-26/+16
2024-06-12Move MatchAgainstFreshVars to old solverMichael Goulet-123/+0
2024-06-11Try not to make obligations in handle_opaque_typeMichael Goulet-16/+7