File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/librustc_typeck/check Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -562,7 +562,19 @@ pub struct FnCtxt<'a, 'tcx> {
562562 // if type checking is run in parallel.
563563 err_count_on_creation : usize ,
564564
565+ /// If `Some`, this stores coercion information for returned
566+ /// expressions. If `None`, this is in a context where return is
567+ /// inappropriate, such as a const expression.
568+ ///
569+ /// This is a `RefCell<DynamicCoerceMany>`, which means that we
570+ /// can track all the return expressions and then use them to
571+ /// compute a useful coercion from the set, similar to a match
572+ /// expression or other branching context. You can use methods
573+ /// like `expected_ty` to access the declared return type (if
574+ /// any).
565575 ret_coercion : Option < RefCell < DynamicCoerceMany < ' tcx > > > ,
576+
577+ /// First span of a return site that we find. Used in error messages.
566578 ret_coercion_span : RefCell < Option < Span > > ,
567579
568580 yield_ty : Option < Ty < ' tcx > > ,
You can’t perform that action at this time.
0 commit comments