about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/infer/mod.rs
AgeCommit message (Collapse)AuthorLines
2023-12-23Give `DiagnosticBuilder` a default type.Nicholas Nethercote-4/+4
`IntoDiagnostic` defaults to `ErrorGuaranteed`, because errors are the most common diagnostic level. It makes sense to do likewise for the closely-related (and much more widely used) `DiagnosticBuilder` type, letting us write `DiagnosticBuilder<'a, ErrorGuaranteed>` as just `DiagnosticBuilder<'a>`. This cuts over 200 lines of code due to many multi-line things becoming single line things.
2023-12-19subtype_predicate: remove unnecessary probelcnr-12/+3
2023-12-15Move nll_relate to relate::nll submoduleMichael Goulet-1/+1
2023-12-15Add higher_ranked to relate submoduleMichael Goulet-1/+0
2023-12-15Move type relations into submodule in rustc_inferMichael Goulet-9/+3
2023-12-15Opportunistically resolve region var in canonicalizerMichael Goulet-10/+2
2023-12-12Auto merge of #118742 - lcnr:infer-var-cleanup, r=compiler-errorsbors-12/+8
refactor infer var storage cleanup the code, discovered while working on #118725
2023-12-08Uplift canonicalizer into new trait solver crateMichael Goulet-22/+50
2023-12-08cleanup type variable storagelcnr-12/+8
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-29Rollup merge of #118269 - compiler-errors:poly, r=wesleywiserMatthias Krüger-1/+0
Unify `TraitRefs` and `PolyTraitRefs` in `ValuePairs` I did this recently with `FnSigs` and `PolyFnSigs` but didn't think to do it with `TraitRefs` and `PolyTraitRefs`.
2023-11-24Unify TraitRefs and PolyTraitRefsMichael Goulet-1/+0
2023-11-23remove unused pub fnklensy-12/+1
2023-11-21Restore closure-kind error messagesMichael Goulet-2/+4
2023-11-14finish `RegionKind` renamelcnr-3/+6
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13continue renaminglcnr-11/+11
- `RegionVariableOrigin::~~Late~~BoundRegion` - `~~Late~~BoundRegionConversionTime`
2023-10-24Get rid of 'tcx on ConstVid, EffectVidMichael Goulet-38/+45
2023-10-23Remove redundant type parameterMichael Goulet-1/+3
2023-10-18Don't ICE when encountering unresolved regions in fully_resolveMichael Goulet-7/+20
2023-09-22Allow higher-ranked fn sigs in ValuePairsMichael Goulet-1/+1
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-2/+5
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-15Canonicalize effect vars in new solverMichael Goulet-0/+4
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-2/+5
2023-09-11Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obkMatthias Krüger-8/+67
Implement fallback for effect param r? `@oli-obk` or `@lcnr` tracking issue for this ongoing work: https://github.com/rust-lang/rust/issues/110395
2023-09-11add `is_host_effect` to `GenericParamDefKind::Const` and address reviewDeadbeef-4/+3
2023-09-10Implement fallback for effect paramDeadbeef-8/+68
2023-09-07Use `newtype_index` for `IntVid` and `FloatVid`.Nicholas Nethercote-2/+2
`TyVid` already uses `newtype_index`.
2023-08-03Rework upcastingMichael Goulet-0/+2
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-22/+22
2023-07-06Add a new trait to `Debug` things with an infcx availableBoxy-0/+38
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-16/+19
2023-07-05Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errorsMichael Goulet-1/+1
`TypeParameterDefinition` always require a `DefId` the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-13/+14
2023-07-04`TypeParameterDefinition` always require a `DefId`lcnr-1/+1
2023-07-01Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errorsbors-28/+13
change snapshot tracking in fulfillment contexts use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-06-29change snapshot tracking in fulfillment contextslcnr-28/+13
2023-06-24instantiate hidden types in root universeAli MJ Al-Nasrawy-0/+1
2023-06-07Rollup merge of #112122 - compiler-errors:next-coherence, r=lcnrDylan DPC-0/+17
Add `-Ztrait-solver=next-coherence` Flag that conditionally uses the trait solver *only* during coherence, for more testing and/or eventual partial-migration onto the trait solver (in the medium- to long-term). * This still uses the selection context in some of the coherence methods I think, so it's not "complete". Putting this up for review and/or for further work in-tree. * I probably need to spend a bit more time making sure that we don't sneakily create any other infcx's during coherence that also need the new solver enabled. r? `@lcnr`
2023-06-06Fix comment for `get_region_var_origins`Nilstrieb-5/+5
2023-06-06New trait solver is a property of inference contextMichael Goulet-0/+17
2023-05-30rework the leak_check to take the outer_universelcnr-33/+22
clean up coherence to not rely on probes anymore
2023-05-29Rename `tcx.mk_re_*` => `Region::new_*`Maybe Waffle-1/+1
2023-05-25Move DefiningAnchorMichael Goulet-12/+1
2023-05-16Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obkNilstrieb-1/+1
Suppress "erroneous constant used" for constants tainted by errors When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not. Fixes #110891.
2023-05-15Combine TypeGeneralizer and GeneralizerMichael Goulet-0/+1
2023-05-15Suppress "erroneous constant used" for constants tainted by errorsTomasz Miąsko-1/+1
When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not.
2023-05-09add EarlyBinder to thir_abstract_const; remove tcx.bound_abstract_constKyle Matsuda-1/+1
2023-05-03remove `inside_canonicalization_ctxt` flaglcnr-32/+0
we never reach the code checking for this flag while the flag is enabled, so it does not change the behavior of the code.
2023-04-27rename `needs_infer` to `has_infer`Boxy-2/+2
2023-04-22Auto merge of #109753 - compiler-errors:replenish-region-constraints, r=aliemjaybors-2/+2
Clone region var origins instead of taking them in borrowck Fixes an issue with the new solver where reporting a borrow-checker error ICEs because it calls `InferCtxt::evaluate_obligation`. This also removes a handful of unnecessary `tcx.infer_ctxt().build()` calls that are only there to mitigate this same exact issue, but with the old solver. Fixes compiler-errors/next-solver-hir-issues#12. ---- This implements `@aliemjay's` solution where we just don't *take* the region constraints, but clone them. This potentially makes it easier to write a bug about taking region constraints twice or never at all, but again, not many folks are touching this code.