Even if the content from box is used in a sharef-ref context, we capture the box entirerly. This is motivated by: 1) We only capture data that is on the stack. 2) Capturing data from within the box might end up moving more data than the user anticipated.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.