Closed jonas-schievink closed 4 years ago
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thejpster (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.
IMO, panicking is too open ended to rely on it for these kind of errors. For example, the chosen panic handler (e.g. panic-semihosting
) could use semihosting to report the panic message to the user. In that case, these unwraps would likely result in infinite recursion (recursive panicking) and thus a stack overflow (UB in MPU-less devices). panic-semihosting
, unlike std
, does not abort on double panic and even if it did the abort handler (HardFault) is user defined so it could call panic!
as well.
I don't have a strong opinion about semihosting though other that it's a pretty bad choice for logging outside of QEMU.
these unwraps would likely result in infinite recursion
Good point, didn't think of that. I see two options:
error
, infinitely loop or ignore errors when error
is called a second time (costs a word of .bss
)I don't have a strong opinion about semihosting though other that it's a pretty bad choice for logging outside of QEMU.
Definitely, but it's still used by many people since the quickstart repo pulls it in. It's also in the rust-embedded
org, which makes it look official and recommended. I almost want to see this crate getting deprecated, but it does have its uses on M0(+) chips.
r? @adamgreig
Build failed:
Arm servers being unreliable again...
bors retry
Hm, can't we use the llvm-binutils instead?
Build failed:
bors retry
Build failed:
bors retry
Build failed:
Urgh, ARM download servers at it again. Can we just put the semihosting asm call into the nice new cortex-m stuff, then call it from here, so this crate doesn't need any asm, any prebuilt files, or need to use gcc?
bors retry
Build succeeded:
Closes #46