I have an extension trait that adds multiple functions, including a sqrt() function, to types that implement it. When I implement the trait, I want to defer some function calls such as sqrt() to the implementation of the underlying primitive, but because I am implementing the function, it has shadowed the the underlying primitive function and I can't call it anymore.
Normally when one trait shadows a function from another type you can do <my_var as TraitName>::sqrt(), but I can't figure out how to do the equivalent for the f32::sqrt() function, because it's on the primitive itself.
Typically, the inherent method or function should always take priority over a method/function coming from a trait. Just calling self.sqrt() in the implementation of your trait should hence still call the standard f32:sqrt method, not the one from your trait.
I don't know about your concrete macro case. If you need more help, you'd need to provide a code example creating the recursion warning. In the mean time good lock solving it yourself
Whoops, I figured it out. The function doesn't exist for the primitive type on #![no_std] targets.
I was confused because the docs for the core crate link to the std crate's documentation for primitives, despite not all of the functions existing for the core versions of the primitives.