Skip to content

Commit 87398f3

Browse files
committed
Add explanatory comment to is_rvalue_or_immutable()
1 parent d204cfd commit 87398f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc/middle/borrowck/gather_loans/lifetime.rs

+5
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ impl GuaranteeLifetimeContext {
170170

171171
fn is_rvalue_or_immutable(&self,
172172
cmt: mc::cmt) -> bool {
173+
//! We can omit the root on an `@T` value if the location
174+
//! that holds the box is either (1) an rvalue, in which case
175+
//! is is in a non-user-accessible temporary, or (2) an immutable
176+
//! lvalue.
177+
173178
cmt.mutbl.is_immutable() || match cmt.guarantor().cat {
174179
mc::cat_rvalue => true,
175180
_ => false

0 commit comments

Comments
 (0)