about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/infer/canonical
AgeCommit message (Collapse)AuthorLines
2025-10-02Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnrbors-102/+43
Split Bound index into Canonical and Bound See [#t-types/trait-system-refactor > perf `async-closures/post-mono-higher-ranked-hang.rs`](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run. r? lcnr
2025-09-30Split Bound into Canonical and Boundjackh726-102/+43
2025-09-26reviewlcnr-7/+4
2025-09-26allow method calls on opaqueslcnr-1/+22
2025-09-08reviewlcnr-3/+10
2025-09-08optimize `CanonicalVarValues::instantiate`lcnr-37/+18
2025-09-08pass `sub_relations` into canonical querieslcnr-46/+69
2025-09-08inline `CanonicalTyVarKind`lcnr-21/+9
2025-08-03Auto merge of #144677 - nnethercote:bound-const-handling, r=lcnrbors-7/+9
Improve bound const handling A few changes to make const handling more similar to type handling. r? `@compiler-errors` -errors
2025-08-01Auto merge of #144446 - nnethercote:opt-region-constraints, r=lcnrbors-21/+4
Optimize region constraints r? `@lcnr`
2025-07-31Overhaul `Constraint`.Nicholas Nethercote-21/+4
This commit changes it to store a `Region` instead of a `RegionVid` for the `Var` cases: - We avoid having to call `Region::new_var` to re-create `Region`s from `RegionVid`s in a few places, avoiding the interning process, giving a small perf win. (At the cost of the type allowing some invalid combinations of values.) - All the cases now store two `Region`s, so the commit also separates the `ConstraintKind` (a new type) from the `sub` and `sup` arguments in `Constraint`.
2025-07-31Make const bound handling more like types/regions.Nicholas Nethercote-7/+9
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-31Remove `ParamEnvAnd::into_parts`.Nicholas Nethercote-1/+1
The fields are public, so this doesn't need a method, normal deconstruction and/or field access is good enough.
2025-07-15Add alias for ArgOutlivesPredicateMichael Goulet-1/+1
2025-07-15Consider outlives assumptions when proving auto traits for coroutine interiorsMichael Goulet-2/+26
2025-07-13Simplify make_query_region_constraintsMichael Goulet-12/+10
2025-06-25rename RegionVariableOrigin::MiscVariable to RegionVariableOrigin::MiscMichael Goulet-4/+1
2025-06-19Cache instantiation of canonical binderMichael Goulet-20/+169
2025-05-29Auto merge of #141581 - lcnr:fold-clauses, r=compiler-errorsbors-0/+4
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-27Rename unpack to kindMichael Goulet-6/+6
2025-05-26add additional `TypeFlags` fast pathslcnr-0/+4
2025-05-27Rollup merge of #141392 - compiler-errors:query-outlives, r=lcnr许杰友 Jieyou Xu (Joe)-54/+8
Avoid obligation construction dance with query region constraints And some renaming...
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-26RenameMichael Goulet-1/+1
2025-05-26Avoid obligation construction dance with query region constraintsMichael Goulet-54/+8
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-06support duplicates in the opaque_types_storagelcnr-19/+7
2025-04-08clean code: remove Deref<Target=RegionKind> impl for Region and use `.kind()`xizheyin-5/+5
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-15Squash fold into tyMichael Goulet-8/+5
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-7/+6
2025-01-13rm unnecessary `OpaqueTypeDecl` wrapperlcnr-2/+2
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-0/+1
2024-12-20remove non-borrowck member constraintslcnr-12/+2
2024-11-23no more Reveal :(lcnr-1/+1
2024-11-04ty::BrK -> ty::BoundRegionKind::KMichael Goulet-1/+1
2024-10-29TypingMode :thinking:lcnr-3/+3
2024-10-24Remove associated type based effects logicMichael Goulet-23/+1
2024-10-17move `defining_opaque_types` out of `Canonical`lcnr-17/+8
2024-10-12Swap Vec<PredicateObligation> to type aliasGnomedDev-3/+4
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-2/+2
2024-09-02chore: Fix typos in 'compiler' (batch 1)Alexander Cyon-1/+1
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_infer`.Nicholas Nethercote-0/+2
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-1/+1
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-29/+30
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-21Rename a bunch of thingsMichael Goulet-2/+2
2024-06-05Basic removal of `Ty` from places (boring)Boxy-24/+16
2024-06-03Nits and formattingMichael Goulet-5/+5
2024-06-03Make TraitEngines generic over errorMichael Goulet-16/+9