WD-40 should only be used to displace water, it has near zero protective properties. In our full scale cannons we always wash them out with hot soapy water, dry them as best we can, then wipe them out with WD-40 to remove all traces of water (especially in the rifled tubes) and then coat them liberally with motor oil. Barrels treated like this never rust, even after long term storage. In the past barrels treated with WD-40 only always began rusting at an alarming rate within 30 days.
Anthony Variz