]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/cfg/construct.rs
Check for uninhabitedness instead of never
[rust.git] / src / librustc / cfg / construct.rs
index c5d6ce24c5df4d03ec132032756ff385f7638f22..0464b2f3454d3a769212479805bcb3ecb4b6c74e 100644 (file)
@@ -415,8 +415,7 @@ fn call<'b, I: Iterator<Item=&'b hir::Expr>>(&mut self,
             args: I) -> CFGIndex {
         let func_or_rcvr_exit = self.expr(func_or_rcvr, pred);
         let ret = self.straightline(call_expr, func_or_rcvr_exit, args);
-        // FIXME(canndrew): This is_never should probably be an is_uninhabited.
-        if self.tables.expr_ty(call_expr).is_never() {
+        if self.tables.expr_ty(call_expr).conservative_is_uninhabited() {
             self.add_unreachable_node()
         } else {
             ret