| Age | Commit message (Collapse) | Author | Lines |
|
More restrictive 2 phase borrows - take 2
Signal lint diagnostic `mutable_borrow_reservation_conflict` when borrow-check finds a 2-phase borrow's reservation overlapping with a shared borrow.
(pnkfelix updated description)
cc #56254 , #59159
blocks PR #59114
r? @pnkfelix
cc @RalfJung @nikomatsakis
|
|
|
|
|
|
We aren't sure if this will become an error or not yet.
|
|
`#[allow(..)]` etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add better error message for partial move
closes #56657
r? @davidtwco
|
|
|
|
This commit fixes the logic of detecting when a use happen in a later
iteration of where a borrow was defined
Fixes #53773
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When trying to use a value after move, instead of using a note, point
at the local declaration that has a type that doesn't implement `Copy`
trait.
|
|
NLL: Add union justifications to conflicting borrows.
Fixes #57100.
This PR adds justifications to error messages for conflicting borrows of union fields.
Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.
r? @pnkfelix
|
|
This commit improves diagnostic labels to mention which field a borrow
overlaps with and adds a note explaining that the fields overlap.
|
|
|
|
describe index with _
|
|
This commit adds justifications to error messages for conflicting
borrows of union fields.
Where previously an error message would say
``cannot borrow `u.b` as mutable..``, it now says
``cannot borrow `u` (via `u.b`) as mutable..``.
|
|
|
|
make non_camel_case_types an early lint
This allows us to catch these kinds of style violations much earlier, as evidenced by the large number of tests that had to be updated for this change.
|
|
address some FIXME whose associated issues were marked as closed
part of #44366
|
|
|
|
|
|
This commit modifies the wording of the warning for
backwards-incompatible changes in migrate mode. The warning messages are
changed to be lowercase and not include line-breaks in order to be
consistent with other compiler diagnostics.
|
|
initialization
|
|
|
|
Enum layout optimizations mean that the discriminant of an enum may not
be stored in a tag disjoint from the rest of the fields of the enum.
Stop borrow checking as though they are.
|
|
|
|
Refer to the second borrow as the "second borrow" in E0501.rs
Fixes #55314.
r? @davidtwco
|
|
|
|
|
|
Since lexical MIR borrow check is gone, and validation no longer uses
these, they can be removed.
|
|
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field
Fixes #55651, #55652.
This PR makes two changes:
First, it updates the dataflow builder to add an init for the place
containing a union if there is an assignment into the field of
that union.
Second, it stops a "use of uninitialized" error occuring when there is an
assignment into the field of an uninitialized union that was previously
initialized. Making this assignment would re-initialize the union, as
tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`.
The check for previous initialization ensures that we do not start
supporting partial initialization yet (cc #21232, #54499, #54986).
This PR also fixes #55652 which was marked as requiring investigation
as the changes in this PR add an error that was previously missing
(and mentioned in the review comments) and confirms that the error
that was present is correct and a result of earlier partial
initialization changes in NLL.
r? @pnkfelix (due to earlier work with partial initialization)
cc @nikomatsakis
|
|
r=davidtwco
NLL: Update box insensitivity test
This is just keeping one of our tests honest with respect to NLL, in two ways:
1. Adds uses of borrows that would otherwise be too short to observe the error that we would have expected to see...
2. ... I say "would have expected" because all of the errors in this file are part of the reversion of rust-lang/rfcs#130 that is attached to NLL (you can see more discussion of this here https://github.com/rust-lang/rust/issues/43234#issuecomment-411017768 )
|
|
pnkfelix:issue-55552-dont-attempt-to-ascribe-projections-out-of-a-ty-var, r=nikomatsakis
Do not attempt to ascribe projections out of a ty var
If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types.
Fix #55552
|
|
(The commit prior to this actual passes our test suite, "thanks"
to #55695. But since I am aware of that bug, I took advantage of it
in choosing how to order my commit series...)
|
|
treatment.
|
|
approximating lexical scope.
|