Skip to content

Commit 71bfd64

Browse files
author
Jakub Bukaj
committed
---
yaml --- r: 157583 b: refs/heads/snap-stage3 c: 6d2080c h: refs/heads/master i: 157581: 7328e01 157579: e3a3934 157575: 5fa3cb6 157567: bcc719a v: v3
1 parent 3af7292 commit 71bfd64

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7f523e72522901d3a0e2666031ec363f5729181a
4+
refs/heads/snap-stage3: 6d2080c44878924bdcde57ec7735327af0ee267d
55
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/liveness.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
* fallthrough node. It is only live if the function could converge
105105
* via means other than an explicit `return` expression. That is, it is
106106
* only dead if the end of the function's block can never be reached.
107+
* It is the responsibility of typeck to ensure that there are no
108+
* `return` expressions in a function declared as diverging.
107109
*/
108110

109111
use middle::def::*;

branches/snap-stage3/src/librustc/middle/trans/callee.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -876,11 +876,8 @@ pub fn trans_call_inner<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
876876
_ => {}
877877
}
878878

879-
match ret_ty {
880-
ty::FnConverging(_) => {},
881-
ty::FnDiverging => {
882-
Unreachable(bcx);
883-
}
879+
if ret_ty == ty::FnDiverging {
880+
Unreachable(bcx);
884881
}
885882

886883
Result::new(bcx, llresult)

branches/snap-stage3/src/librustc/middle/trans/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn trans_intrinsic_call<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, node: ast::N
204204

205205
fcx.pop_custom_cleanup_scope(cleanup_scope);
206206

207-
// The only intrinsic function that diverges.
207+
// These are the only intrinsic functions that diverge.
208208
if name.get() == "abort" {
209209
let llfn = ccx.get_intrinsic(&("llvm.trap"));
210210
Call(bcx, llfn, [], None);

branches/snap-stage3/src/librustc/util/ppaux.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -957,12 +957,10 @@ impl Repr for ty::FnSig {
957957
impl Repr for ty::FnOutput {
958958
fn repr(&self, tcx: &ctxt) -> String {
959959
match *self {
960-
ty::FnConverging(ty) => {
961-
format!("FnConverging({0})", ty.repr(tcx))
962-
}
963-
ty::FnDiverging => {
964-
"FnDiverging".to_string()
965-
}
960+
ty::FnConverging(ty) =>
961+
format!("FnConverging({0})", ty.repr(tcx)),
962+
ty::FnDiverging =>
963+
"FnDiverging".to_string()
966964
}
967965
}
968966
}

0 commit comments

Comments
 (0)