]> git.lizzy.rs Git - rust.git/commitdiff
Add doc comment explaining what `BlockTailInfo` is.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 5 Oct 2018 10:26:29 +0000 (12:26 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 5 Oct 2018 10:26:29 +0000 (12:26 +0200)
src/librustc/mir/mod.rs

index 5ea097e72433d405f5d8d396013114becf192f6b..2ae06e9ab0de79affb0a60c7c38dde9cbe217045 100644 (file)
@@ -638,6 +638,14 @@ fn hash_stable<W: StableHasherResult>(
     }
 }
 
+/// `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