You can paint metal with rust, but you need to ensure that the rust is not loose. Sand down the area first and then apply a rust-resistant primer or another product to protect against rust before you apply your paint.