A call inside a #[kernel] body gets __exec threaded through it (and
::<N, _> supplied) only when the path is a single segment starting with a
lowercase letter or _ — rewrite.rs:1236-1249:
let single = p.qself.is_none()
&& p.path.leading_colon.is_none()
&& p.path.segments.len() == 1;
So m::k(x) and Self::k(x) compile as ordinary Rust calls with no exec
threading, and a kernel can only be called by a bare name.
The restriction is there because the prelude re-exports math, reduce and
rng as modules, so math::exp(x) and friends have to stay ordinary calls.
Telling the two apart is not possible syntactically — the macro never inspects
types — so this needs a marker of some kind.
A call inside a
#[kernel]body gets__execthreaded through it (and::<N, _>supplied) only when the path is a single segment starting with alowercase letter or
_—rewrite.rs:1236-1249:So
m::k(x)andSelf::k(x)compile as ordinary Rust calls with no execthreading, and a kernel can only be called by a bare name.
The restriction is there because the prelude re-exports
math,reduceandrngas modules, somath::exp(x)and friends have to stay ordinary calls.Telling the two apart is not possible syntactically — the macro never inspects
types — so this needs a marker of some kind.