about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
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
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
2022-07-20Rollup merge of #99383 - ouz-a:issue_57961, r=oli-obkDylan DPC-47/+70
Formalize defining_use_anchor This tackles issue #57961 Introduces new enum called `DefiningAnchor` that replaces `Option<LocalDefId>` of `defining_use_anchor`. Now every use of it is explicit and exhaustively matched, catching errors like one in the linked issue. This is not a perfect fix but it's a step in the right direction. r? `@oli-obk`
2022-07-20Rollup merge of #99345 - compiler-errors:issue-99073-redux, r=oli-obkDylan DPC-1/+1
Do not allow typeck children items to constrain outer RPITs Fixes #99073 in a simpler and more conservative way than #99079. Simply raise a mismatched types error if we try to constrain an RPIT in an item that isn't the RPIT's parent. r? `@oli-obk`
2022-07-20take opaq typesouz-a-47/+70
2022-07-19use opaque_ty_origin_unchecked instead of destructuring HIRMichael Goulet-1/+1
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-1/+1
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-19Use LocalDefId in OpaqueTypeKeyMichael Goulet-14/+20
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-1/+1
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-16Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, ↵Matthias Krüger-2/+2
r=compiler-errors Avoid some `Symbol` to `String` conversions This patch removes some Symbol to String conversions.