VALTREE_MAX_NODES is 100_000. Assuming your tensor is 768 x 256 that indeed exceeds this limit. The reason it works outside of clippy is likely that nothing is turning the contant into a val tree. If you use a value as const generic, it is turned into a val tree. Some lint inside clippy is likely also turning consts into val trees. Try building with -Ztreat-err-as-bug on nightly to get a backtrace where this happens.