I was reading the platform sources for the runtime and I found this peculiar sys::cleanup implementation on teeos (aarch64-unknown-teeos):
|
pub unsafe fn cleanup() { |
|
unimplemented!() |
|
// We do NOT have stack overflow handler, because TEE OS will kill TA when it happens. |
|
// So cleanup is commented |
|
// stack_overflow::cleanup(); |
|
} |
This function is always invoked after main. The unsupported.rs implementation is to just do nothing, but this is panicking instead. Even if it is somehow intentional, an rtabort call would surely be much more appropriate in this context, given that unimplemented involves a call to the global allocator and panic hook.
It just looks wrong. Am I missing something?
@rustbot label T-libs O-teeos
I was reading the platform sources for the runtime and I found this peculiar
sys::cleanupimplementation on teeos (aarch64-unknown-teeos):rust/library/std/src/sys/pal/teeos/mod.rs
Lines 33 to 38 in 28e8a8c
This function is always invoked after
main. Theunsupported.rsimplementation is to just do nothing, but this is panicking instead. Even if it is somehow intentional, anrtabortcall would surely be much more appropriate in this context, given thatunimplementedinvolves a call to the global allocator and panic hook.It just looks wrong. Am I missing something?
@rustbot label T-libs O-teeos