mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
Add explanatory comment to is_rvalue_or_immutable()
This commit is contained in:
parent
d204cfd739
commit
87398f31e5
@ -170,6 +170,11 @@ impl GuaranteeLifetimeContext {
|
||||
|
||||
fn is_rvalue_or_immutable(&self,
|
||||
cmt: mc::cmt) -> bool {
|
||||
//! We can omit the root on an `@T` value if the location
|
||||
//! that holds the box is either (1) an rvalue, in which case
|
||||
//! is is in a non-user-accessible temporary, or (2) an immutable
|
||||
//! lvalue.
|
||||
|
||||
cmt.mutbl.is_immutable() || match cmt.guarantor().cat {
|
||||
mc::cat_rvalue => true,
|
||||
_ => false
|
||||
|
Loading…
Reference in New Issue
Block a user