about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-10-05 12:26:29 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-10-05 12:26:29 +0200
commit704877f2ad7e3424a5c0286aed8697ba498fb234 (patch)
tree8dec16d07ac3f8461497ec788ee661a14a3bbebf
parent056cfffd1ba69e2e80d87c728d8475944dfbe050 (diff)
downloadrust-704877f2ad7e3424a5c0286aed8697ba498fb234.tar.gz
rust-704877f2ad7e3424a5c0286aed8697ba498fb234.zip
Add doc comment explaining what `BlockTailInfo` is.
-rw-r--r--src/librustc/mir/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index 5ea097e7243..2ae06e9ab0d 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -638,6 +638,14 @@ mod binding_form_impl {
     }
 }
 
+/// `BlockTailInfo` is attached to the `LocalDecl` for temporaries
+/// created during evaluation of expressions in a block tail
+/// expression; that is, a block like `{ STMT_1; STMT_2; EXPR }`.
+///
+/// It is used to improve diagnostics when such temporaries are
+/// involved in borrow_check errors, e.g. explanations of where the
+/// temporaries come from, when their destructors are run, and/or how
+/// one might revise the code to satisfy the borrow checker's rules.
 #[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
 pub struct BlockTailInfo {
     /// If `true`, then the value resulting from evaluating this tail