Skip to content

Commit ad1faa7

Browse files
committed
---
yaml --- r: 221061 b: refs/heads/auto c: d066a7b h: refs/heads/master i: 221059: 79f8be6 v: v3
1 parent 87c2fad commit ad1faa7

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
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 2d68d09b4679018d0ba3faf41d239251991bf17b
11+
refs/heads/auto: d066a7b5069ff857a5bffe7cb5168fe63158144f
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/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)