about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/diagnostics
AgeCommit message (Collapse)AuthorLines
2022-10-27Revert "Make ClosureOutlivesRequirement not rely on an unresolved type"Michael Goulet-27/+21
This reverts commit a6b5f95fb028f9feb4a2957c06b35035be2c6155.
2022-10-27(almost) Always use ObligationCtxt when dealing with canonical queriesMichael Goulet-23/+18
2022-10-22Don't ICE on regions from anonymous_lifetime_in_impl_traitMichael Goulet-8/+92
2022-10-20Add context to compiler error messageb4den-1/+1
Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`
2022-10-20Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgrbors-2/+9
Rollup of 6 pull requests Successful merges: - #103197 (Stabilize proc_macro::Span::source_text) - #103251 (Fix item declaration highlighting) - #103262 (Adjusting test to needs-unwind, with linking issue) - #103268 (rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`) - #103272 (Remove extra spaces in docs) - #103276 (Erase regions before checking for `Default` in uninitialized binding error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-19Erase regions before checking for default in uninitialized binding errorMichael Goulet-2/+9
2022-10-19Make ClosureOutlivesRequirement not rely on an unresolved typeMichael Goulet-21/+27
2022-10-16Auto merge of #102080 - yanchen4791:issue-99824-fix, r=cjgillotbors-133/+23
Fix missing explanation of where the borrowed reference is used when the same borrow occurs multiple times due to loop iterations Fix #99824. Problem of the issue: If a borrow occurs in a loop, the borrowed reference could be invalidated at the same place at next iteration of the loop. When this happens, the point where the borrow occurs is the same as the intervening point that might invalidate the reference in the loop. This causes a problem for the current code finding the point where the resulting reference is used, so that the explanation of the cause will be missing. As the second point of "explain all errors in terms of three points" (see [leveraging intuition framing errors in terms of points"](https://rust-lang.github.io/rfcs/2094-nll.html#leveraging-intuition-framing-errors-in-terms-of-points), this explanation is very helpful for user to understand the error. In the current implementation, the searching region for finding the location where the borrowed reference is used is limited to between the place where the borrow occurs and the place where the reference is invalidated. If those two places happen to be the same, which indicates that the borrow and invalidation occur at the same place in a loop, the search will fail. One solution to the problem is when these two places are the same, find the terminator of the loop, and then use the location of the loop terminator instead of the location of the borrow for the region to find the place where the borrowed reference is used.
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-100/+67
2022-10-07Remove TypeckResults from InferCtxtCameron Steffen-2/+2
2022-10-07Introduce TypeErrCtxtCameron Steffen-34/+31
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't need to.
2022-10-06Auto merge of #99324 - reez12g:issue-99144, r=jyn514bors-1/+1
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
2022-10-02Remove 'E0312' from 'compile_fail,E0312' statement temporarilyreez12g-1/+1
2022-09-29Generate synthetic impl region even in closure body in associated fnMichael Goulet-5/+3
2022-09-29Mark ignore on error code docs in ↵reez12g-1/+1
compiler/rustc_borrowck/src/diagnostics/region_errors.rs
2022-09-28Fix missing explanation of where borrowed reference is used when the borrow ↵Yan Chen-133/+23
occurs in loop iteration
2022-09-26Auto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisabors-0/+70
Suggest Default::default() when binding isn't initialized Fixes #102087
2022-09-26fix #102087, Suggest Default::default() when binding isn't initializedyukang-0/+70
2022-09-25Rollup merge of #101431 - compiler-errors:move-place-ty-for-move-place-sugg, ↵fee1-dead-6/+6
r=cjgillot Look at move place's type when suggesting mutable reborrow Not sure why we are looking at the use site's ty instead of the move site's ty in order to suggest reborrowing the move site, but it was suppressing a perfectly valid reborrow suggestion. r? `@estebank` who i think touched this last in 520461f1fb2730f8edb17922f3bcc74fccdc52d3, though that was quite a while ago so feel free to reassign.
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-5/+7
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-20Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebankbors-1/+6
Allow patterns to constrain the hidden type of opaque types fixes #96572 reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864) TODO: * check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+1
2022-09-17Use Predicate ConstraintCategory when normalizingJack Huey-6/+14
2022-09-16Final bitsJack Huey-1/+4
2022-09-16Add ExtraConstraintInfoJack Huey-8/+18
2022-09-16Add outlives_constraint to BlameConstraintJack Huey-6/+7
2022-09-16Revert "Better errors for implied static bound"Jack Huey-26/+12
This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.
2022-09-16Revert "Use Predicate ConstraintCategory when normalizing"Jack Huey-14/+6
This reverts commit aae37f87632dd74856d55c0cd45d2c192379c990.
2022-09-16Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, ↵Oli Scherer-1/+6
r=estebank"" This reverts commit 4a742a691e7dd2522bad68b86fe2fd5a199d5561.
2022-09-13Use Predicate ConstraintCategory when normalizingJack Huey-6/+14
2022-09-13Better errors for implied static boundJack Huey-12/+26
2022-09-13Remove unused body argsJack Huey-9/+6
2022-09-13Use tcx.hir() utils for spans in MIR building.Camille GILLOT-3/+4
This corrects the `span_with_body` in the case of closures, which was incorrectly shortened to the `def_span`.
2022-09-13Only keep one version of ImplicitSelfKind.Camille GILLOT-6/+3
2022-09-10Auto merge of #98559 - jackh726:remove-reempty, r=oli-obkbors-5/+1
Remove ReEmpty r? rust-lang/types
2022-09-09Handle generic parameters.Camille GILLOT-1/+1
2022-09-08Remove ReEmptyJack Huey-5/+1
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-1/+1
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-05Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, ↵bors-12/+7
r=cjgillot Separate the receiver from arguments in HIR Related to #100232 cc `@cjgillot`
2022-09-05use `propagate_through_exprs` instead of `propagate_through_expr`Takayuki Maeda-2/+0
fix `ExprKind` static_assert_size fix hir-stats
2022-09-05Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkovbors-4/+5
Simplify `hir::PathSegment` r? `@petrochenkov`
2022-09-05refactor: remove unnecessary variablesTakayuki Maeda-1/+2
2022-09-05separate the receiver from arguments in HIRTakayuki Maeda-12/+8
2022-09-05Look at move place's type when suggesting mutable reborrowMichael Goulet-6/+6
2022-09-05Don't suggest reborrow if usage is inside a closureMichael Goulet-1/+2
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-4/+5
2022-09-02Refactor and re-use BindingAnnotationCameron Steffen-1/+1
2022-09-01Rollup merge of #101285 - ↵Matthias Krüger-3/+11
TaKO8Ki:do-not-suggest-adding-move-when-closure-is-already-marked-as-move, r=oli-obk Do not suggest adding `move` to closure when `move` is already used Fixes #101227
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+0
by module
2022-09-01Directly use the `instrument` macro instead of its full pathOli Scherer-5/+5