about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2025-06-25rename RegionVariableOrigin::MiscVariable to RegionVariableOrigin::MiscMichael Goulet-15/+9
2025-06-25Remove some glob imports from the type systemMichael Goulet-39/+40
2025-06-25Compute hard errors without diagnostics in ↵Michael Goulet-1/+2
impl_intersection_has_impossible_obligation
2025-06-24Introduce trivial WF functions, use it in fast pathMichael Goulet-0/+7
2025-06-19Cache instantiation of canonical binderMichael Goulet-20/+169
2025-06-18Implement lint against direct uses of rustc_type_ir in compiler cratesRomain Perier-0/+1
This commit adds a lint to prevent the use of rustc_type_ir in random compiler crates, except for type system internals traits, which are explicitly allowed. Moreover, this fixes diagnostic_items() to include the CRATE_OWNER_ID, otherwise rustc_diagnostic_item attribute is ignored on the crate root.
2025-06-11Auto merge of #141763 - lcnr:fixme-gamer, r=BoxyUwUbors-1/+4
`FIXME(-Znext-solver)` triage r? `@BoxyUwU`
2025-06-11Auto merge of #142090 - compiler-errors:perf-stable-root-var, r=lcnrbors-0/+6
Make root vars more stable Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in rust-lang/rust#141500 more "stable" when there are a lot of vars flying around. r? `@ghost`
2025-06-08Remove all unused feature gates from the compilerbjorn3-1/+0
2025-06-07Rollup merge of #142126 - compiler-errors:normalize-uv-via-relate, r=BoxyUwUGuillaume Gomez-0/+7
Treat normalizing consts like normalizing types in deeply normalize ...so that we don't end up putting a top-level normalizes-to goal in the fulfillment context, which ICEs. This basically just models the normalize-const code off of the normalize-ty code above it, which uses an alias-relate goal instead. Fixes rust-lang/rust#140571 r? lcnr
2025-06-07Unify normalization of terms in deeply normalizeMichael Goulet-0/+7
2025-06-05Make root vars more stableMichael Goulet-0/+6
2025-06-03`FIXME(-Znext-solver)` triagelcnr-1/+4
Co-authored-by: Michael Goulet <michael@errs.io>
2025-06-02Fast path for stalled obligations on self tyMichael Goulet-1/+1
2025-05-29Auto merge of #141581 - lcnr:fold-clauses, r=compiler-errorsbors-0/+12
add additional `TypeFlags` fast paths Some crates, e.g. `diesel`, have items with a lot of where-clauses (more than 150). In these cases checking the `TypeFlags` of the whole `param_env` can be very beneficial. This adds `fn fold_clauses` to mirror the existing `fn visit_clauses` and then uses this in folders which fold `ParamEnv`s. Split out from rust-lang/rust#141451, depends on rust-lang/rust#141442. r? `@compiler-errors`
2025-05-27Fix some var namesMichael Goulet-2/+2
2025-05-27Rename unpack to kindMichael Goulet-13/+13
2025-05-26Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxubors-80/+58
Rollup of 10 pull requests Successful merges: - rust-lang/rust#140898 (minor improvements on running miri) - rust-lang/rust#141392 (Avoid obligation construction dance with query region constraints) - rust-lang/rust#141431 (Emit dummy open drop for unsafe binder) - rust-lang/rust#141433 (Properly analyze captures from unsafe binders) - rust-lang/rust#141439 (Deduplicate dyn compatibility violations due to coercion) - rust-lang/rust#141449 (further deduplicate ast visitor code) - rust-lang/rust#141513 (interpret: add allocation parameters to `AllocBytes`) - rust-lang/rust#141516 (speed up charsearcher for ascii chars) - rust-lang/rust#141526 (add a dedicated section for compiler environment variables in the unstable book) - rust-lang/rust#141550 (Fix `unused_braces` lint suggestion when encountering attributes) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-26add additional `TypeFlags` fast pathslcnr-0/+12
2025-05-27Rollup merge of #141392 - compiler-errors:query-outlives, r=lcnr许杰友 Jieyou Xu (Joe)-80/+58
Avoid obligation construction dance with query region constraints And some renaming...
2025-05-26Auto merge of #141500 - compiler-errors:rerun-cache-2, r=lcnrbors-0/+57
Don't rerun goals if none of their vars have changed r? `@ghost` Alternative to rust-lang/rust#141488. I'm pretty sure that we don't need to re-run the goal at all if the inputs don't change... 🤔
2025-05-26Auto merge of #141442 - compiler-errors:fast-path-pred, r=lcnrbors-0/+4
Fold predicate fast path in canonicalizer and eager resolver See individual commits. r? lcnr
2025-05-26Don't rerun goals if none of its vars have changedMichael Goulet-0/+57
2025-05-26RenameMichael Goulet-19/+28
2025-05-26Avoid obligation construction dance with query region constraintsMichael Goulet-71/+40
2025-05-25Fast path fold_predicate in old canonicalizerMichael Goulet-0/+4
2025-05-25Don't use relation just to equate regions in responseMichael Goulet-5/+5
2025-05-23yeet `CanonicalVarInfo`lcnr-99/+78
2025-05-17Fast path for register_region_obligationMichael Goulet-0/+8
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-05-08Rollup merge of #140641 - lcnr:opaque-type-storage-entries, r=compiler-errorsMatthias Krüger-3/+88
detect additional uses of opaques after writeback Based on #140607. It's a lot harder to encounter in practice than I though :sweat_smile: :grin: I've still added it with the expectation that somebody will encounter it at some point. Also modifies the `EvalCtxt` to use the same impl to detect newly added opaque types. r? ``@compiler-errors``
2025-05-07detect additional uses of opaques after writebacklcnr-3/+49
2025-05-07opaque_type_storage to InferCtxtLikelcnr-0/+39
2025-05-07Require T: TypeFoldable in Binder<T> visitMichael Goulet-4/+0
2025-05-07Rollup merge of #140607 - lcnr:opaque-type-storage, r=compiler-errorsJacob Pratt-48/+83
support duplicate entries in the opaque_type_storage Necessary for the new solver as we may unify keys when eagerly resolving for canonical queries. See the relevant comment when instantiating query responses: ```rust // We eagerly resolve inference variables when computing the query response. // This can cause previously distinct opaque type keys to now be structurally equal. // // To handle this, we store any duplicate entries in a separate list to check them // at the end of typeck/borrowck. We could alternatively eagerly equate the hidden // types here. However, doing so is difficult as it may result in nested goals and // any errors may make it harder to track the control flow for diagnostics. if let Some(prev) = prev { self.delegate.add_duplicate_opaque_type(key, prev, self.origin_span); } ``` This will be far more relevant with #140497. r? `@compiler-errors`
2025-05-06support duplicates in the opaque_types_storagelcnr-48/+83
2025-05-06Rename `graph::implementation::Graph` to `LinkedGraph`Zalathar-4/+4
2025-05-05Rollup merge of #140559 - rperier:type-ir-to-type-middle, r=compiler-errorsGuillaume Gomez-29/+17
Removing rustc_type_ir in the rustc_infer codebase cc #138449 This is a second refactoring of rustc_type_ir to use rustc_middle instead, this time that's for rustc_infer
2025-05-02Use less rustc_type_ir in the compiler codebaseRomain Perier-29/+17
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-05-01Set groundwork for proper const normalizationBoxy-8/+17
2025-04-28Rollup merge of #140249 - BoxyUwU:remove_weak_alias_terminology, r=oli-obkGuillaume Gomez-1/+1
Remove `weak` alias terminology I find the "weak" alias terminology to be quite confusing. It implies the existence of "strong" aliases (which do not exist) and I'm not really sure what about weak aliases is "weak". I much prefer "free alias" as the term. I think it's much more obvious what it means as "free function" is a well defined term that already exists in rust. It's also a little confusing given "weak alias" is already a term in linker/codegen spaces which are part of the compiler too. Though I'm not particularly worried about that as it's usually very obvious if you're talking about the type system or not lol. I'm also currently trying to write documentation about aliases and it's somewhat awkward/confusing to be talking about *weak* aliases, when I'm not really sure what the basis for that as the term actually *is*. I would also be happy to just find out there's a nice meaning behind calling them "weak" aliases :-) r? `@oli-obk` maybe we want a types MCP to decide on a specific naming here? or maybe we think its just too late to go back on this naming decision ^^'
2025-04-26convert some `GenericArg` to `Term`lcnr-3/+13
2025-04-25Rollup merge of #140202 - est31:let_chains_feature_compiler, r=lcnrMatthias Krüger-1/+1
Make #![feature(let_chains)] bootstrap conditional in compiler/ Let chains have been stabilized recently in #132833, so we can remove the gating from our uses in the compiler (as the compiler uses edition 2024).
2025-04-24Remove `weak` alias terminologyBoxy-1/+1
2025-04-23MoreMichael Goulet-2/+4
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-22Properly drain pending obligations for coroutinesMichael Goulet-3/+3
2025-04-16Auto merge of #139768 - compiler-errors:split-fold, r=lcnrbors-32/+7
Split `TypeFolder` and `FallibleTypeFolder` atwain Right now there is a coherence problem with `TypeFolder` and `FallibleTypeFolder`. Namely, it's impossible to implement a `FallibleTypeFolder` that is generic over interner, b/c it has a *downstream* conflict with the blanket impl: ``` impl<I, F> FallibleTypeFolder<I> for F where F: TypeFolder<I> {} ``` Because downstream crates may implement `TypeFolder<SomeLocalInterner>` for the fallible type folder. This PR removes the relationship between `FallibleTypeFolder` and `TypeFolder`; it leads to *modest* code duplication, but otherwise does not affect perf and really doesn't matter in general.
2025-04-14Use `newtype_index!`-generated types more idiomaticallyYotam Ofek-6/+5
2025-04-14Derive Obligation's fold implsMichael Goulet-32/+7