Skip to content

Commit e99c7d8

Browse files
committed
---
yaml --- r: 224167 b: refs/heads/beta c: d066a7b h: refs/heads/master i: 224165: 85b7527 224163: 7fa71a0 224159: 3dca388 v: v3
1 parent 139ec43 commit e99c7d8

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 2d68d09b4679018d0ba3faf41d239251991bf17b
26+
refs/heads/beta: d066a7b5069ff857a5bffe7cb5168fe63158144f
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/test/compile-fail/pushpop-unsafe-rejects.rs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,30 @@ fn main() {
4545
});
4646

4747

48-
// Note: For implementation simplicity I have chosen to just have
49-
// the stack do "saturated pop", but perhaps we would prefer to
50-
// have cases like these two here be errors:
51-
52-
pop_unsafe!{ g() };
53-
54-
push_unsafe!({
55-
pop_unsafe!(pop_unsafe!{ g() })
56-
});
57-
58-
59-
// Okay, back to examples that do error, even in the presence of
60-
// "saturated pop"
61-
62-
push_unsafe!({
63-
g();
64-
pop_unsafe!(pop_unsafe!({
65-
f() //~ ERROR: call to unsafe function
66-
}))
67-
});
68-
69-
pop_unsafe!({
70-
f(); //~ ERROR: call to unsafe function
71-
})
48+
// Note: For implementation simplicity the compiler just
49+
// ICE's if you underflow the push_unsafe stack.
50+
//
51+
// Thus all of the following cases cause an ICE.
52+
//
53+
// (The "ERROR" notes are from an earlier version
54+
// that used saturated arithmetic rather than checked
55+
// arithmetic.)
56+
57+
// pop_unsafe!{ g() };
58+
//
59+
// push_unsafe!({
60+
// pop_unsafe!(pop_unsafe!{ g() })
61+
// });
62+
//
63+
// push_unsafe!({
64+
// g();
65+
// pop_unsafe!(pop_unsafe!({
66+
// f() // ERROR: call to unsafe function
67+
// }))
68+
// });
69+
//
70+
// pop_unsafe!({
71+
// f(); // ERROR: call to unsafe function
72+
// })
7273

7374
}

0 commit comments

Comments
 (0)