Skip to content

Commit 704877f

Browse files
committed
Add doc comment explaining what BlockTailInfo is.
1 parent 056cfff commit 704877f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/librustc/mir/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,14 @@ mod binding_form_impl {
638638
}
639639
}
640640

641+
/// `BlockTailInfo` is attached to the `LocalDecl` for temporaries
642+
/// created during evaluation of expressions in a block tail
643+
/// expression; that is, a block like `{ STMT_1; STMT_2; EXPR }`.
644+
///
645+
/// It is used to improve diagnostics when such temporaries are
646+
/// involved in borrow_check errors, e.g. explanations of where the
647+
/// temporaries come from, when their destructors are run, and/or how
648+
/// one might revise the code to satisfy the borrow checker's rules.
641649
#[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
642650
pub struct BlockTailInfo {
643651
/// If `true`, then the value resulting from evaluating this tail

0 commit comments

Comments
 (0)