about summary refs log tree commit diff
path: root/compiler/rustc_infer
AgeCommit message (Collapse)AuthorLines
2022-08-22get rid of `RefCell` in `TransitiveRelation`SparrowLii-18/+46
2022-08-21Rework point-at-argMichael Goulet-10/+17
2022-08-20Rollup merge of #100691 - compiler-errors:issue-100690, r=estebankMatthias Krüger-53/+79
Make `same_type_modulo_infer` a proper `TypeRelation` Specifically, this fixes #100690 because we no longer consider a `ReLateBound` and a `ReVar` to be equal. `ReVar` can only be equal to free regions or static.
2022-08-20Rollup merge of #100617 - chenyukang:fix-100605, r=compiler-errorsMatthias Krüger-1/+2
Suggest the right help message for as_ref Fixes #100605
2022-08-20Suggest the right help message for as_refyukang-1/+2
2022-08-18Auto merge of #99860 - oli-obk:revert_97346, r=pnkfelixbors-6/+8
Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, … …r=oli-obk" This reverts commit c703d11dccb4a895c7aead3b2fcd8cea8c483184, reversing changes made to 64eb9ab869bc3f9ef3645302fbf22e706eea16cf. it didn't apply cleanly, so now it works the same for RPIT and for TAIT instead of just working for RPIT, but we should keep those in sync anyway. It also exposed a TAIT bug (see the feature gated test that now ICEs). r? `@pnkfelix` fixes #99536
2022-08-17Make same_type_modulo_infer a proper TypeRelationMichael Goulet-53/+79
2022-08-17ty::Error does not match other types for region constraintsMichael Goulet-1/+8
2022-08-16Fix error message with non-tupled bare fn traitMichael Goulet-0/+13
2022-08-14TypeError can be CopyMichael Goulet-15/+13
2022-08-13Do not inline non-simple argument type errors into labelsMichael Goulet-3/+3
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-08-10Delay a bug if we try and fail to relate an opaque to itself in TypeRelatingMichael Goulet-0/+4
2022-08-10Fall back when relating two opaques by substs in MIR typeckMichael Goulet-24/+30
2022-08-09don't normalize wf predicateslcnr-1/+1
this allows us to soundly use unnormalized projections for wf
2022-08-03Rollup merge of #100102 - b-naber:typo-higher-ranked-sub, r=Dylan-DPCMatthias Krüger-1/+1
Fix typo r? ```@jackh726```
2022-08-03Remove index from Region::EarlyBound.Camille GILLOT-4/+4
2022-08-03fix typob-naber-1/+1
2022-08-03Auto merge of #99509 - lcnr:commit_unconditionally, r=jackh726bors-12/+0
remove `commit_unconditionally` `commit_unconditionally` is a noop unless we somehow inspect the current state of our snapshot. The only thing which does that is the leak check which was only used in one place where `commit_if_ok` is probably at least as, or even more, correct. r? rust-lang/types
2022-08-02Auto merge of #100032 - BoxyUwU:no_ty_in_placeholder_const, r=compiler-errorsbors-10/+15
make `PlaceholderConst` not store the type of the const Currently the `Placeholder` variant on `ConstKind` is 28 bytes when with this PR its 8 bytes, i am not sure this is really useful at all rn since `Unevaluated` and `Value` variants are huge still but eventually it should be possible to get both down to 16 bytes :thinking:. Mostly opening this to see if this change has any perf impact when done before it can make `ConstKind`/`ConstS` smaller
2022-08-02Rollup merge of #99156 - lcnr:omoe-wa, r=wesleywiserMatthias Krüger-4/+2
`codegen_fulfill_obligation` expect erased regions it's a query, so by erasing regions before calling it, we get better caching. This doesn't actually change anything as its already the status quo.
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-4/+5
2022-08-01fmt...Ellen-5/+10
2022-08-01make `PlaceholderConst` not store the type of the constEllen-7/+7
2022-07-31use appropriate `HirID` for finding `else_span`Takayuki Maeda-6/+10
2022-07-30Rollup merge of #99311 - kckeiks:clean-up-body-owner-methods, r=cjgillotDylan DPC-3/+6
change maybe_body_owned_by to take local def id Issue https://github.com/rust-lang/rust/issues/96341 r? `@cjgillot`
2022-07-30Auto merge of #99796 - compiler-errors:issue-53475, r=oli-obkbors-0/+10
use `check_region_obligations_and_report_errors` to avoid ICEs If we don't call `process_registered_region_obligations` before `resolve_regions_and_report_errors` then we'll ICE if we have any region obligations, and `check_region_obligations_and_report_errors` just does both of these for us in a nice convenient function. Fixes #53475 r? types
2022-07-30Do not leak type variables from opaque type relationMichael Goulet-3/+14
2022-07-29Rename local_did to def_idMiguel Guarniz-3/+3
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-3/+6
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29optimize bound vars replacement :3lcnr-2/+2
2022-07-29Document check_region_obligations_and_report_errors, simplify a call to ↵Michael Goulet-0/+10
resolve_regions
2022-07-28Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk"Oli Scherer-6/+8
This reverts commit c703d11dccb4a895c7aead3b2fcd8cea8c483184, reversing changes made to 64eb9ab869bc3f9ef3645302fbf22e706eea16cf.
2022-07-28anonymize all bound vars, not just regionslcnr-4/+4
2022-07-28`BoundVarReplacer`: trait object instead of 3 fnslcnr-62/+88
2022-07-27Auto merge of #99725 - lcnr:dedup-region_bound_pairs, r=compiler-errorsbors-14/+19
use `FxIndexSet` for `region_bound_pairs` should help with #99217 and might generally be a perf improvement. r? types
2022-07-27Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkovGuillaume Gomez-30/+1
Clean up HIR-based lifetime resolution Based on https://github.com/rust-lang/rust/pull/97313. Fixes #98932. r? `@petrochenkov`
2022-07-27fix universe map in ifcx.instantiate_canonical_*Ali MJ Al-Nasrawy-3/+3
Previously, `infcx.instantiate_canonical_*` maps the root universe in `canonical` into `ty::UniverseIndex::Root`, I think because it assumes it works with a fresh `infcx` but this is not true for the use cases in mir typeck. Now the root universe is mapped into `infcx.universe()`. I catched this accidentally while reviewing the code. I'm not sure if this is the right fix or if it is really a bug!
2022-07-27Rollup merge of #99079 - compiler-errors:issue-99073, r=oli-obkYuki Okushi-1/+1
Check that RPITs constrained by a recursive call in a closure are compatible Fixes #99073 Adapts a similar visitor pattern to `find_opaque_ty_constraints` (that we use to check TAITs), but with some changes: 0. Only walk the "OnlyBody" children, instead of all items in the RPIT's defining scope 1. Only walk through the body's children if we found a constraining usage 2. Don't actually do any inference, just do a comparison and error if they're mismatched ---- r? `@oli-obk` -- you know all this impl-trait stuff best... is this the right approach? I can explain the underlying issue better if you'd like, in case that might reveal a better solution. Not sure if it's possible to gather up the closure's defining usages of the RPIT while borrowck'ing the outer function, that might be a better place to put this check...
2022-07-26Stop creating anonymous late lifetimes.Camille GILLOT-30/+1
2022-07-26Rollup merge of #99729 - cjgillot:rm-unused-tuple, r=michaelwoeristerMatthias Krüger-22/+18
Remove unused tuple fields Found by https://github.com/rust-lang/rust/pull/95977
2022-07-26Rollup merge of #99748 - compiler-errors:better-impl-trait-printing, r=fee1-deadDylan DPC-15/+8
Use full type name instead of just saying `impl Trait` in "captures lifetime" error I think this is very useful, especially when there's >1 `impl Trait`, and it just means passing around a bit more info that we already have access to.
2022-07-26Rollup merge of #99618 - compiler-errors:uhh-idk, r=lcnrDylan DPC-6/+55
handle consts with param/infer in `const_eval_resolve` better This PR addresses [this thread here](https://github.com/rust-lang/rust/pull/99449#discussion_r924141230). Was this the change you were looking for ``@lcnr?`` Interestingly, one test has begun to pass. Was that expected? r? ``@lcnr``
2022-07-26Revert "use opaque_ty_origin_unchecked instead of destructuring HIR"Michael Goulet-1/+1
This reverts commit 5a4601fea56502e4f50df046c4205e678397599b.
2022-07-26Address nits, move substs replacement to separate functionMichael Goulet-27/+41
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-15/+8
2022-07-25handle consts with param/infer in const_eval_resolve betterMichael Goulet-6/+41
2022-07-25Unused tuple fields in rustc_infer.Camille GILLOT-22/+18
2022-07-25use `FxIndexSet` for `region_bound_pairs`lcnr-14/+19
2022-07-24Combine redundant obligation cause codesMichael Goulet-61/+37