about summary refs log tree commit diff
path: root/compiler/rustc_borrowck
AgeCommit message (Collapse)AuthorLines
2022-08-29Various changes to logging of borrowck-related codeJack Huey-67/+29
2022-08-29Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obkMatthias Krüger-10/+10
Replace `Body::basic_blocks()` with field access Since the refactoring in #98930, it is possible to borrow the basic blocks independently from other parts of MIR by accessing the `basic_blocks` field directly. Replace unnecessary `Body::basic_blocks()` method with a direct field access, which has an additional benefit of borrowing the basic blocks only.
2022-08-28Rollup merge of #101002 - estebank:hashmap-idx, r=davidtwcoMatthias Krüger-3/+113
Provide structured suggestion for `hashmap[idx] = val`
2022-08-26Replace `Body::basic_blocks()` with field accessTomasz Miąsko-10/+10
2022-08-26diag-migAndyJado-76/+169
2022-08-25Provide structured suggestion for `hashmap[idx] = val`Esteban Küber-3/+113
2022-08-24Rollup merge of #100940 - ↵Matthias Krüger-0/+3
TaKO8Ki:do-not-suggest-adding-bound-to-opaque-type, r=fee1-dead Do not suggest adding a bound to a opaque type fixes #100442
2022-08-24Rollup merge of #100906 - ChayimFriedman2:map-index-mut, r=davidtwcoMatthias Krüger-2/+17
Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing The error can be quite confusing to newcomers. Fixes #100873. I'm not so sure about the message, open to wording suggestions.
2022-08-24Rollup merge of #100901 - TaKO8Ki:make-some-methods-private, r=sanxiynMatthias Krüger-1/+2
Make some methods private
2022-08-24do not suggest adding a bound to a opaque typeTakayuki Maeda-1/+5
2022-08-23Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexingChayim Refael Friedman-2/+17
The error can be quite confusing to newcomers.
2022-08-22get rid of `RefCell` in `TransitiveRelation`SparrowLii-21/+22
2022-08-22make some methods privateTakayuki Maeda-1/+2
2022-08-21Rollup merge of #100761 - lcnr:mir-typeck-cleanup, r=compiler-errorsMatthias Krüger-90/+58
some general mir typeck cleanup this pr contains the parts of #95763 which already work correctly. the remaining commits of that PR have some issues which are more complex to fix. r? types
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-4/+4
2022-08-20Rollup merge of #100186 - compiler-errors:or-as_mut, r=fee1-deadMatthias Krüger-8/+6
Mention `as_mut` alongside `as_ref` in borrowck error message Kinda fixes #99426 but I guess that really might be better staying open to see if we could make it suggest `as_mut` in a structured way. Not sure how to change borrowck to know that info tho.
2022-08-19move `type_check_internal` into `type_check`lcnr-85/+52
2022-08-19small mir typeck cleanuplcnr-5/+6
2022-08-16Make as_ref suggestion a noteMichael Goulet-8/+6
2022-08-15Fix #95079 by adding help and suggestion for missing move in nested closureYan Chen-0/+37
2022-08-14Suggest as_ref or as_mutMichael Goulet-1/+1
2022-08-14TypeError can be CopyMichael Goulet-3/+1
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-08-10Use &mut Diagnostic instead of &mut DiagnosticBuilder unless neededMichael Goulet-8/+3
2022-08-09don't normalize wf predicateslcnr-24/+39
this allows us to soundly use unnormalized projections for wf
2022-08-04Rollup merge of #100095 - jackh726:early-binder, r=lcnrMatthias Krüger-16/+16
More EarlyBinder cleanups Each commit is independent r? types
2022-08-04Rollup merge of #100093 - wcampbell0x2a:unused-parens-for-match-arms, ↵Matthias Krüger-1/+1
r=petrochenkov Enable unused_parens for match arms Fixes: https://github.com/rust-lang/rust/issues/92751 Currently I can't get the `stderr` to work with `./x.py test`, but this should fix the issue. Help would be appreciated!
2022-08-04Enable unused_parens for match armswcampbell-1/+1
2022-08-04Auto merge of #100120 - matthiaskrgr:rollup-g6ycykq, r=matthiaskrgrbors-0/+45
Rollup of 6 pull requests Successful merges: - #98771 (Add support for link-flavor rust-lld for iOS, tvOS and watchOS) - #98835 (relate `closure_substs.parent_substs()` to parent fn in NLL) - #99746 (Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`) - #99786 (Recover from C++ style `enum struct`) - #99795 (Delay a bug when failed to normalize trait ref during specialization) - #100029 (Prevent ICE for `doc_alias` on match arm, statement, expression) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-03fix trailing whitespace in error messageklensy-1/+1
2022-08-03cosmetic changesAli MJ Al-Nasrawy-5/+11
2022-08-02Add bound_predicates_of and bound_explicit_predicates_ofJack Huey-16/+16
2022-08-02NLL: relate closure to parent fnAli MJ Al-Nasrawy-0/+39
2022-07-31Improve `cannot move out of` error messageObei Sideg-32/+100
2022-07-31Rollup merge of #99186 - camsteffen:closure-localdefid, r=cjgillotDylan DPC-44/+36
Use LocalDefId for closures more
2022-07-30Use LocalDefId for closures moreCameron Steffen-44/+36
2022-07-29Change enclosing_body_owner to return LocalDefIdMiguel Guarniz-2/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-2/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Auto merge of #99667 - ouz-a:some_branch, r=oli-obkbors-1/+1
Optimize `UnDerefer` Addresses the performance [issues](https://github.com/rust-lang/rust/pull/98145#issuecomment-1183548597) faced here. r? `@oli-obk`
2022-07-27Auto merge of #99725 - lcnr:dedup-region_bound_pairs, r=compiler-errorsbors-15/+16
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-2/+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-21/+0
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-26Replace LifetimeRes::Anonymous by LifetimeRes::Infer.Camille GILLOT-1/+1
2022-07-26Remove the distinction between LifetimeName::Implicit and ↵Camille GILLOT-1/+0
LifetimeName::Underscore.
2022-07-26Rollup merge of #99748 - compiler-errors:better-impl-trait-printing, r=fee1-deadDylan DPC-7/+16
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-26Revert "Do not allow typeck children items to constrain outer RPITs"Michael Goulet-29/+0
This reverts commit e8d9f38141a0ee8ac5484783e1fb5c218f9d2eee.
2022-07-26Revert "use opaque_ty_origin_unchecked instead of destructuring HIR"Michael Goulet-4/+12
This reverts commit 5a4601fea56502e4f50df046c4205e678397599b.
2022-07-26Use real opaque type instead of just saying impl TraitMichael Goulet-7/+16
2022-07-25use `FxIndexSet` for `region_bound_pairs`lcnr-15/+16
2022-07-25avoid `&str`/`Symbol` to `String` conversionsTakayuki Maeda-5/+3