]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix
authorManish Goregaokar <manishsmail@gmail.com>
Thu, 9 Apr 2015 10:23:59 +0000 (15:53 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 9 Apr 2015 18:54:42 +0000 (00:24 +0530)
 Modify the ExprUseVisitor to walk each part of an AutoRef, and in
particular to treat an AutoUnsize as as kind of \"instantaneous\" borrow
of the value being unsized. This prevents us from feeding uninitialized
data.

This caused a problem for the eager reborrow of comparison traits,
because that wound up introducing a \"double AutoRef\", which was not
being thoroughly checked before but turned out not to type check.
Fortunately, we can just remove that \"eager reborrow\" as it is no longer
needed now that `PartialEq` doesn't force both LHS and RHS to have the
same type (and even if we did have this problem, the better way would be
to lean on introducing a common supertype).

Fixes #20791.

r? @nrc


Trivial merge