about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
AgeCommit message (Collapse)AuthorLines
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-15/+10
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-11/+8
rustc: Remove needless lifetimes
2022-12-23Verify receiver is of `self: Pin<&mut Self>`Esteban Küber-2/+6
2022-12-23Suggest `.clone()` on method call move errorsEsteban Küber-9/+34
2022-12-23Suggest `Pin::as_mut` when encountering borrow errorEsteban Küber-0/+11
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-11/+8
2022-12-20Hackily fix an opaque type ICEOli Scherer-5/+13
2022-12-20Some style nitsOli Scherer-1/+1
2022-12-20Replace a `find` with a loop to simplify the logic.Oli Scherer-19/+22
2022-12-20Make it easier to debug where a region error was createdOli Scherer-3/+19
2022-12-20Some tracing cleanupsOli Scherer-4/+2
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-18/+15
Improve syntax of `newtype_index` This makes it more like proper Rust and also makes the implementation a lot simpler. Mostly just turns weird flags in the body into proper attributes. It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.
2022-12-19Rollup merge of #105864 - matthiaskrgr:compl, r=NilstriebDylan DPC-6/+1
clippy::complexity fixes filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool r? `@compiler-errors`
2022-12-19clippy::complexity fixesMatthias Krüger-6/+1
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
2022-12-18Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=NilstriebMatthias Krüger-3/+3
use &str / String literals instead of format!()
2022-12-18Rollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errorsMatthias Krüger-2/+2
don't clone Copy types
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-11/+6
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-7/+9
This removes the `custom` format functionality as its only user was trivially migrated to using a normal format. If a new use case for a custom formatting impl pops up, you can add it back.
2022-12-18use &str / String literals instead of format!()Matthias Krüger-3/+3
2022-12-18remove redundant fn params that were only "used" in recursionMatthias Krüger-26/+3
2022-12-18don't clone Copy typesMatthias Krüger-2/+2
2022-12-15Auto merge of #105657 - oli-obk:mk_projection_ty, r=lcnrbors-2/+2
Guard ProjectionTy creation against passing the wrong number of substs r? `@lcnr`
2022-12-15Auto merge of #104765 - chenyukang:yukang-fix-104639-lifetime-check, r=oli-obkbors-20/+7
Find the right lower bound region in the scenario of partial order relations Fixes #104639