about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/traits/project.rs
AgeCommit message (Collapse)AuthorLines
2025-02-08Rustfmtbjorn3-4/+4
2024-10-12Swap Vec<PredicateObligation> to type aliasGnomedDev-3/+3
2024-10-08Improve formatting of some comments.Nicholas Nethercote-30/+23
I.e. fixing comments lines that are too long or too short.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+4
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_infer`.Nicholas Nethercote-0/+1
2024-08-27Add `warn(unreachable_pub)` to `rustc_infer`.Nicholas Nethercote-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-9/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-05-13Apply nitsMichael Goulet-5/+8
2024-05-13split out AliasTy -> AliasTermMichael Goulet-11/+7
2024-04-20include ParamEnv in projection cache keyLukas Markeffsky-2/+3
2024-03-07move snapshot handling into modlcnr-1/+1
2023-07-30inline format!() args up to and including rustc_codegen_llvmMatthias Krüger-4/+4
2023-04-26Remove unused `TypeFoldable`/`TypeVisitable` impls.Nicholas Nethercote-1/+1
2023-04-17Spelling - compilerJosh Soref-1/+1
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-12-18don't restuct references just to reborrowMatthias Krüger-1/+1
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-2/+2
2022-07-08Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiserbors-1/+1
don't succeed `evaluate_obligation` query if new opaque types were registered fixes #98608 fixes #98604 The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked. I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this. Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-1/+1
2022-06-30use a method instead of manually doing what its body doesOli Scherer-1/+1
2022-02-14Call the method fork instead of clone and add proper commentsSantiago Pastorino-1/+1
2022-01-28Remove generalization over projectionkadmin-2/+6
Instead, just use a term everywhere.
2021-12-19Rollup merge of #91878 - LegionMammal978:less-inband-infer, r=Aaron1011Matthias Krüger-1/+1
Remove `in_band_lifetimes` from `rustc_infer` See #91867 for more information. This crate actually had a typo `'ctx` in one of its functions: ```diff -pub fn same_type_modulo_infer(a: Ty<'tcx>, b: Ty<'ctx>) -> bool { +pub fn same_type_modulo_infer<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool { ``` Also, I wasn't entirely sure about the lifetimes in `suggest_new_region_bound`: ```diff pub fn suggest_new_region_bound( - tcx: TyCtxt<'tcx>, + tcx: TyCtxt<'_>, err: &mut DiagnosticBuilder<'_>, fn_returns: Vec<&rustc_hir::Ty<'_>>, ``` Should all of those lifetimes really be distinct?
2021-12-18Re-introduce concept of projection cache 'completion'Aaron Hill-3/+69
Instead of clearing out the cache entirely, we store the intermediate evaluation result into the cache entry. This accomplishes several things: * We avoid the performance hit associated with re-evaluating the sub-obligations * We avoid causing issues with incremental compilation, since the final evaluation result is always the same * We avoid affecting other uses of the same `InferCtxt` which might care about 'side effects' from processing the sub-obligations (e,g. region constraints). Only code that is specifically aware of the new 'complete' code is affected
2021-12-13Remove `in_band_lifetimes` from `rustc_infer`LegionMammal978-1/+1
This crate actually had a typo `'ctx` in one of its functions: ```diff -pub fn same_type_modulo_infer(a: Ty<'tcx>, b: Ty<'ctx>) -> bool { +pub fn same_type_modulo_infer<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool { ```
2021-09-14Remove concept of 'completion' from the projection cacheAaron Hill-41/+0
Fixes #88910 When we initially store a `NormalizedTy` in the projection cache, we discard all obligations that we can (while ensuring that we don't cause any issues with incremental compilation). Marking a projection cache entry as 'completed' discards all obligations associated with it. This can only cause problems, since any obligations stored in the cache are there for a reason (e.g. they evaluate to `EvaluatedToOkModuloRegions`). This commit removes `complete` and `complete_normalized` entirely.
2020-12-20Prevent caching projections in the case of cyclesMatthew Jasper-1/+15
When normalizing a projection which results in a cycle, we would cache the result of `project_type` without the nested obligations (because they're not needed for inference). This would result in the nested obligations only being handled once in fulfill, which would avoid the cycle error. Fixes #79714, a regresion from #79305 caused by the removal of `get_paranoid_cache_value_obligation`.
2020-08-30mv compiler to compiler/mark-0/+212