If you are just painting over rust with standard metal paint, it won’t stop the rust from spreading. It will look better cosmetically, but you should remove the rust first and then use a primer for the best results.
You can buy products like this Black Star Liquid Rust Converter that turns rust into a paintable surface.