summary refs log tree commit diff
path: root/compiler/rustc_borrowck
AgeCommit message (Collapse)AuthorLines
2023-01-21Auto merge of #106976 - tmiasko:borrowck-lazy-dominators, r=cjgillotbors-8/+12
Lazy dominator tree construction in borrowck Motivated by the observation that sometimes constructed dominator tree was never queried.
2023-01-19even more unify Projection/Opaque in outlives codeAli MJ Al-Nasrawy-2/+2
2023-01-18Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obkbors-1/+1
Do not filter substs in `remap_generic_params_to_declaration_params`. The relevant filtering should have been performed by borrowck. Fixes https://github.com/rust-lang/rust/issues/105826 r? types
2023-01-18Rollup merge of #106747 - yanchen4791:issue-105507-fix, r=estebankMatthias Krüger-4/+121
Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB Fix for issue #105507 The problem: When generic associated types (GATs) are from higher-ranked trait bounds (HRTB), they are implied 'static requirement (see [Implied 'static requirement from higher-ranked trait bounds](https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds) for more details). If the user did not explicitly specify the `'static` lifetime when using the GAT, the current error message will only point out the type `does not live long enough` where the type is used, but not where the GAT is specified and how to fix the problem. The solution: Add notes at the span where the problematic GATs are specified and suggestions of how to fix the problem by adding `'static` lifetime at the right spans.
2023-01-17Lazy dominator tree construction in borrowckTomasz Miąsko-8/+12
Motivated by the observation that sometimes constructed dominator tree was never queried.
2023-01-17Add 'static lifetime suggestion when GAT implied 'static requirement from HRTByanchen4791-4/+121
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-14/+14
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-14/+14
2023-01-17Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorinoMatthias Krüger-7/+2
Unify `Opaque`/`Projection` handling in region outlives code They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias` r? types
2023-01-16Rollup merge of #106940 - oli-obk:tait_error, r=compiler-errorsMatthias Krüger-12/+21
Improve a TAIT error and add an error code plus documentation cc https://github.com/rust-lang/rust/issues/106858
2023-01-16Improve a TAIT error and add an error code plus documentationOli Scherer-12/+21
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-27/+21
2023-01-15Make InstantiatedPredicates impl IntoIteratorMichael Goulet-5/+1
2023-01-14Fix some missed double spaces.André Vennberg-1/+1
2023-01-14Removed various double spaces in compiler source comments.André Vennberg-1/+1
2023-01-13Unify Opaque/Projection handling in region outlives codeMichael Goulet-7/+2
2023-01-13Rollup merge of #106641 - chenyukang:yukang/fix-105761-segguest-this, r=estebankMatthias Krüger-5/+145
Provide help on closures capturing self causing borrow checker errors Fixes #105761 r? ````@estebank````
2023-01-12Fix ICE formattingEsteban Küber-1/+1
2023-01-12take care when there is no args in method callyukang-14/+12
2023-01-12Provide help on closures capturing self causing borrow checker errorsyukang-5/+147
2023-01-11Do not filter substs in `remap_generic_params_to_declaration_params`.Camille GILLOT-1/+1
The relevant filtering should have been performed by borrowck.
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-3/+3
2023-01-10Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obkYuki Okushi-2/+2
No need to take opaques in `check_type_bounds` `InferCtxt` already has its defining use anchor set to err r? ``@oli-obk``
2023-01-09Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-deadbors-92/+63
Rollup of 10 pull requests Successful merges: - #105292 (Change a commit_if_ok call to probe) - #105655 (Remove invalid case for mutable borrow suggestion) - #106047 (Fix ui constant tests for big-endian platforms) - #106061 (Enable Shadow Call Stack for Fuchsia on AArch64) - #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`) - #106291 (Fix incorrect suggestion for extra `&` in pattern) - #106389 (Simplify some canonical type alias names) - #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`) - #106549 (Use fmt named parameters in rustc_borrowck) - #106614 (error-code docs improvements (No. 2)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-09Assert defining anchor is set in take_opaque_typesMichael Goulet-2/+2
2023-01-09Rollup merge of #106549 - wcampbell0x2a:use-fmt-named-parameters-borrowck, ↵fee1-dead-92/+63
r=estebank Use fmt named parameters in rustc_borrowck
2023-01-09Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnrbors-150/+130
Don't normalize in AstConv See individual commits. Fixes #101350 Fixes #54940
2023-01-08Rollup merge of #106410 - clubby789:borrow-mut-self-mut-self-diag, ↵Yuki Okushi-11/+16
r=compiler-errors Suggest `mut self: &mut Self` for `?Sized` impls Closes #106325 Closes #93078 The suggestion is _probably_ not what the user wants (hence `MaybeIncorrect`) but at least makes the problem in the above issues clearer. It might be better to add a note explaining why this is the case, but I'm not sure how best to word that so this is a start. ``@rustbot`` label +A-diagnostics
2023-01-07Rollup merge of #106509 - estebank:closure-in-block, r=davidtwcoMatthias Krüger-11/+41
Detect closures assigned to binding in block Fix #58497.
2023-01-07make ascribe_user_type a TypeOpAli MJ Al-Nasrawy-150/+130
Projection types in user annotations may contain inference variables. This makes the normalization depend on the unification with the actual type and thus requires a separate TypeOp to track the obligations. Otherwise simply calling `TypeChecker::normalize` would ICE with "unexpected ambiguity"
2023-01-06Use fmt named parameters in rustc_borrowckwcampbell-92/+63
2023-01-05Suggests adding named lifetime when the return contains value borrowed from ↵yanchen4791-2/+11
more than one lifetimes of the function's inputs
2023-01-05Detect closures assigned to binding in blockEsteban Küber-11/+41
Fix #58497.
2023-01-05Explain error with `&mut self` for unsized trait implsclubby789-11/+16
2023-01-04Rollup merge of #106403 - compiler-errors:rename-hir-methods, r=cjgillotMichael Goulet-2/+2
Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent` The `hir::Map::get_parent_node` function doesn't return a `Node`, and I think that's quite confusing. Let's rename it to something that sounds more like something that gets the parent hir id => `hir::Map::parent_id`. Same with `find_parent_node` => `opt_parent_id`. Also, combine `hir.get(hir.parent_id(hir_id))` and similar `hir.find(hir.parent_id(hir_id))` function into new functions that actually retrieve the parent node in one call. This last commit is the only one that might need to be looked at closely.
2023-01-04Merge borrowck permission checksGiacomo Pasini-37/+11
Merge `check_access_permission` and `check_if_reassignment_to_immutable_state`. The goal of this commit is twofold: First, we simplify the codebase by removing duplicate logic. Second, we avoid duplicate reporting of illegal reassignment errors by reusing the exiting de-duplicating logic of access_place.
2023-01-04Address commentsMichael Goulet-67/+8
2023-01-04Simplify some iterator combinatorsMichael Goulet-42/+31
2023-01-04rename get_parent_node to parent_idMichael Goulet-2/+2
2023-01-01Verbose suggestionsEsteban Küber-3/+3
2023-01-01Merge multiple mutable borrows of immutable binding errorsEsteban Küber-35/+107
Fix #53466.
2022-12-31Auto merge of #106245 - estebank:mutability-suggestions, r=jyn514bors-21/+12
Use verbose suggestions for mutability errors
2022-12-28Use verbose suggestions for mutability errorsEsteban Küber-21/+12
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-7/+4
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-27Auto merge of #106095 - estebank:pin-mut-reborrow, r=compiler-errorsbors-10/+59
Suggest `Pin::as_mut` when encountering borrow error Fix #65409 for `Pin<&mut T>`.
2022-12-26review commentsEsteban Küber-7/+5
2022-12-25Remove redundant clone suggestionEsteban Küber-1/+13
2022-12-25Create new inference contextEsteban Küber-29/+33
2022-12-25fix more clippy::style findingsMatthias Krüger-23/+22
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-23Do not use `hir_ty_to_ty`Esteban Küber-16/+10