title: @inbounds propagation rules in Julia
body: <p>I'm looking for some clarification of the <a href="https://docs.julialang.org/en/v1/devdocs/boundscheck/" rel="nofollow noreferrer">bounds checking rules</a> in Julia. Is this meaning that if I put <code>@inbounds</code> at the beginning of the for loop,</p>
  <pre><code>@inbounds for ... end
  </code></pre>
  <p>then only for &quot;one layer&quot; inbounds propagates, so if there is a for loop inside of that, <code>@inbounds</code> will not turn off the bounds checking in there? And if I use <code>@propagate_inbounds</code>, it will go inside the nested for loop?</p>
  <p>And is it correct to say <code>@inbounds</code> always wins over <code>@boundscheck</code>? The only exception if the function is not inlined, but is that just a case of the previous &quot;one layer&quot; rule, so <code>@propagate_inbounds</code> would turn off the bounds checking even in the non-inlined function call?</p>