| Age | Commit message (Collapse) | Author | Lines |
|
This reverts commit a6b5f95fb028f9feb4a2957c06b35035be2c6155.
|
|
|
|
|
|
Changed `creates a temporary which is freed while still in use` to
`creates a temporary value which is freed while still in use`
|
|
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
|
|
|
|
|
|
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.
|
|
|
|
|
|
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't
need to.
|
|
Enable doctests in compiler/ crates
Helps with https://github.com/rust-lang/rust/issues/99144
|
|
|
|
|
|
compiler/rustc_borrowck/src/diagnostics/region_errors.rs
|
|
occurs in loop iteration
|
|
Suggest Default::default() when binding isn't initialized
Fixes #102087
|
|
|
|
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.
|
|
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)`
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.
|
|
This reverts commit aae37f87632dd74856d55c0cd45d2c192379c990.
|
|
r=estebank""
This reverts commit 4a742a691e7dd2522bad68b86fe2fd5a199d5561.
|
|
|
|
|
|
|
|
This corrects the `span_with_body` in the case of closures, which was
incorrectly shortened to the `def_span`.
|
|
|
|
Remove ReEmpty
r? rust-lang/types
|
|
|
|
|
|
`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.
|
|
r=cjgillot
Separate the receiver from arguments in HIR
Related to #100232
cc `@cjgillot`
|
|
fix `ExprKind` static_assert_size
fix hir-stats
|
|
Simplify `hir::PathSegment`
r? `@petrochenkov`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
by module
|
|
|