diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-07-23 23:39:02 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-07-23 23:39:28 +0200 |
| commit | d066a7b5069ff857a5bffe7cb5168fe63158144f (patch) | |
| tree | 3cf2adbb07659559ca294c6ae687ca198f92f571 /src | |
| parent | 2d68d09b4679018d0ba3faf41d239251991bf17b (diff) | |
update compile-fail/pushpop-unsafe-rejects.rs to reflect switch from saturated to checked arith.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/compile-fail/pushpop-unsafe-rejects.rs | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/test/compile-fail/pushpop-unsafe-rejects.rs b/src/test/compile-fail/pushpop-unsafe-rejects.rs index ad6fd5094db..72c065ae714 100644 --- a/src/test/compile-fail/pushpop-unsafe-rejects.rs +++ b/src/test/compile-fail/pushpop-unsafe-rejects.rs @@ -45,29 +45,30 @@ fn main() { }); - // Note: For implementation simplicity I have chosen to just have - // the stack do "saturated pop", but perhaps we would prefer to - // have cases like these two here be errors: - - pop_unsafe!{ g() }; - - push_unsafe!({ - pop_unsafe!(pop_unsafe!{ g() }) - }); - - - // Okay, back to examples that do error, even in the presence of - // "saturated pop" - - push_unsafe!({ - g(); - pop_unsafe!(pop_unsafe!({ - f() //~ ERROR: call to unsafe function - })) - }); - - pop_unsafe!({ - f(); //~ ERROR: call to unsafe function - }) + // Note: For implementation simplicity the compiler just + // ICE's if you underflow the push_unsafe stack. + // + // Thus all of the following cases cause an ICE. + // + // (The "ERROR" notes are from an earlier version + // that used saturated arithmetic rather than checked + // arithmetic.) + + // pop_unsafe!{ g() }; + // + // push_unsafe!({ + // pop_unsafe!(pop_unsafe!{ g() }) + // }); + // + // push_unsafe!({ + // g(); + // pop_unsafe!(pop_unsafe!({ + // f() // ERROR: call to unsafe function + // })) + // }); + // + // pop_unsafe!({ + // f(); // ERROR: call to unsafe function + // }) } |
