summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-08-30Auto 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-15Revert let_chains stabilizationNilstrieb-1/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. It was discovered that they are not implemented correctly, which does not make them ready for stabilization.
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-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-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-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-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
2022-07-24Handle additional lifetime bounds on GATs like on methodsMichael Goulet-9/+15
2022-07-24Slightly improve mismatched GAT where clause errorMichael Goulet-52/+18
2022-07-24Auto merge of #93429 - fee1-dead-contrib:allow-super-trait-tilde-const, ↵bors-1/+6
r=oli-obk Allow `trait A: ~const B` What's included: a minimal working change set for `~const` supertraits to work. r? `@oli-obk`
2022-07-23Remap elaborated obligation constnessDeadbeef-1/+6
2022-07-23Rollup merge of #99580 - fmease:fix-issue-99565, r=estebankMatthias Krüger-6/+35
Don't suggest unnameable generic arguments Fixes #99565. `@rustbot` label T-compiler A-diagnostics r? `@rust-lang/wg-diagnostics`
2022-07-22Rollup merge of #99539 - compiler-errors:bidirectional-block-suggestions, ↵Dylan DPC-117/+422
r=fee1-dead Improve suggestions for returning binding Fixes #99525 Also reworks the cause codes for match and if a bit, I think cleaning them up in a positive way. We no longer need to call `could_remove_semicolon` in successful code, which might save a few cycles?
2022-07-22Don't suggest unnameable generic argumentsLeón Orell Valerian Liehr-6/+35
2022-07-21Address more nitsMichael Goulet-37/+31
2022-07-21Generalize same_type_modulo_inferMichael Goulet-3/+34
2022-07-21`region_outlives_predicate` no snapshotlcnr-10/+5
2022-07-21move `considering_regions` to the infcxlcnr-2/+21
2022-07-21And for patterns tooMichael Goulet-78/+89
2022-07-21Do if-expression obligation stuff less eagerlyMichael Goulet-38/+297
2022-07-21Resolve vars in same_type_modulo_inferMichael Goulet-68/+78
2022-07-20Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisabors-3/+3
Remove the unused StableSet and StableMap types from rustc_data_structures. The current implementation is not "stable" in the same sense that `HashStable` and `StableHasher` are stable, i.e. across compilation sessions. So, in my opinion, it's better to remove those types (which are basically unused anyway) than to give the wrong impression that these are safe for incr. comp. I plan to provide new "stable" collection types soon that can be used to replace `FxHashMap` and `FxHashSet` in query results (see [draft](https://github.com/michaelwoerister/rust/commit/69d03ac7a7d651a397ab793e9d78f8fce3edf7a6)). It's unsound that `HashMap` and `HashSet` implement `HashStable` (see https://github.com/rust-lang/rust/issues/98890 for a recent P-critical bug caused by this) -- so we should make some progress there.
2022-07-20remove `commit_unconditionally`lcnr-12/+0
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-3/+3