update compile-fail/pushpop-unsafe-rejects.rs to reflect switch from saturated to checked arith.
This commit is contained in:
parent
2d68d09b46
commit
d066a7b506
@ -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
|
||||
// })
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user