File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/librustc/middle/typeck/check Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1127,6 +1127,16 @@ pub fn break_here() {
11271127 debug ! ( "break here!" ) ;
11281128}
11291129
1130+ /// Invariant:
1131+ /// If an expression has any sub-expressions that result in a type error,
1132+ /// inspecting that expression's type with `ty::type_is_error` will return
1133+ /// true. Likewise, if an expression is known to diverge, inspecting its
1134+ /// type with `ty::type_is_bot` will return true (n.b.: since Rust is
1135+ /// strict, _|_ can appear in the type of an expression that does not,
1136+ /// itself, diverge: for example, fn() -> _|_.)
1137+ /// Note that inspecting a type's structure *directly* may expose the fact
1138+ /// that there are actually multiple representations for both `ty_err` and
1139+ /// `ty_bot`, so avoid that when err and bot need to be handled differently.
11301140 pub fn check_expr_with_unifier( fcx: @mut FnCtxt ,
11311141 expr: @ast:: expr,
11321142 expected: Option < ty:: t > ,
You can’t perform that action at this time.
0 commit comments