While Set
isn't a scoping construct (SC), it is considered one by other SCs outer to it. ref / Set / Details[[-3]] (thanks to Alexey PopkovAlexey Popkov for correcting me).
Here it is inner to the Module
and Module
decides not to interfere in this case (don't know why), but you can trick it:
Module[{x},
Set @@ {f[x_], Integrate[y^2, {y, 0, x}]};
]
?f
f[x$301_]=x$301^3/3
Further reading: Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructsEnforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs