Gevrey and analytic hypoellipticity on the torus for non-linear operators constructed from rigid vector fields