]> git.lizzy.rs Git - rust.git/commit
Fix the handling of assignments to owning pointer paths in check_loans
authorCameron Zwarich <zwarich@mozilla.com>
Fri, 30 May 2014 04:17:49 +0000 (21:17 -0700)
committerCameron Zwarich <zwarich@mozilla.com>
Fri, 30 May 2014 05:02:57 +0000 (22:02 -0700)
commit5aff0e7cec9a3833ea67477bca13efcb4d950db7
treef5158518c790ed91d3f76ee8a47e1a7b1c833809
parent81c022317a67042f6eef9491a12d6bdb10cf6e46
Fix the handling of assignments to owning pointer paths in check_loans

Make check_for_assignment_to_restricted_or_frozen_location treat
mutation through an owning pointer the same way it treats mutation
through an &mut pointer, where mutability must be inherited from the
base path.

I also included GC pointers in this check, as that is what the
corresponding code in gather_loans/restrictions.rs does, but I don't
think there is a way to test this with the current language.

Fixes #14498.
src/librustc/middle/borrowck/check_loans.rs
src/test/compile-fail/borrowck-issue-14498.rs [new file with mode: 0644]