From d066a7b5069ff857a5bffe7cb5168fe63158144f Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Thu, 23 Jul 2015 23:39:02 +0200 Subject: [PATCH] update compile-fail/pushpop-unsafe-rejects.rs to reflect switch from saturated to checked arith. --- .../compile-fail/pushpop-unsafe-rejects.rs | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/test/compile-fail/pushpop-unsafe-rejects.rs b/src/test/compile-fail/pushpop-unsafe-rejects.rs index ad6fd5094db4..72c065ae7141 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: + // 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() }) - }); - - - // 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 - }) + // 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 + // }) }