I see this line in LLVM output of a crate: (context: https://github.com/rust-lang/rust/issues/75089)
; core::fmt::num::imp::<impl core::fmt::Display for i32>::fmt ; Function Attrs: nounwind declare zeroext i1 @"_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h9ba9fea9cadf7bd5E"(i32* noalias readonly align 4 dereferenceable(4), %"core::fmt::Formatter"* align 4 dereferenceable(36)) unnamed_addr #1
I'm confused about the
i1 part here. I don't understand LLVM syntax in details, but I think this is declaring address of a function, but the type is
i1 which is just one bit? This can't be right. Am I missing anything? What exactly does this line declare?
that's the return type.
Interesting.. how can it return a single bit value for
Result<(), Error>? It takes two arguments so I think it's not taking an argument for the return value
Error is a ZST, so you only need 1 bit to represent the result
Makes sense, thanks.