Commercial rust removers found in grocery stores are effective and safe for most fabrics. Rust removers that contain hydrofluoric acid are extremely toxic and can burn skin and damage appliance finishes.
Lemon juice and salt are readily available, much less toxic and will often give great results. Sprinkle salt on the stain, squeeze lemon juice onto the salt and spread the garment in the sun to dry. This works best on a colorfast garments. Test on a seam or inconspicuous spot to see if fading or bleaching occurs. You should have no problems with white or ecru fabrics.
Rust stains cannot be removed by normal laundering. Using chlorine bleach will make them permanent.
Some rust-colored stains are not caused by rust. Caramelized sugar and benzoyl peroxide (acne medicine) stains look like rust. Do a bit of investigating before treating the stains.

