I guess any carbon steel barrel can rust if it is exposed to condensation , but what caliber is this rifle, since usually only very old or soviet block ammo is corrosive. The other thing to consider is how you prepare the weapon for storage ? If I know a rifle is expected to go into the safe for a long time, I will give the barrel a thorough cleaning and the bore a final patch with some synthetic oil and make sure the external surfaces are likewise lubed with a synthetic oil. Paste wax is more effective than oil but harder to apply.
I have had 2 rifles with a corroded bore, one was a yugoslavian SKS where the preservative never made it into the bore and it was likely stored for 50 years before I bought it. I got the free rust out but the pitting is there forever and that part of the barrel will foul with copper like crazy every time I shoot it. The other was an AR-15 that was chambered in 7.62x39 that I shot some corrosive Yugoslavian ammo in and it flash rusted in just a few days after shooting it. I saw the rust on the flash suppressor first, then found the bore was red too.
I used both a bronze bore brush and later a nylon bore brush and had to scrub the bore for several hours and wash it out with water and detergent to get the corrosive salts out. There was no pitting because the exposure was such a short time, but its likely that the wear of the barrel from scrubbing with polishing compound may be equivalent to a few thousand rounds.... Given that the 7.62x39 is not a particularly accurate cartridge to begin with and that rifle in particular was never better than a 2MOA rifle, there was no change in performance afterwards. Had it been a more accurate rifle, that might not have been the outcome.,
I think that the way the AR gas system works, it is a particularly bad match to corrosive ammo, since the corrosive gasses are directed to the inside of the bolt. The AK/SKS style gas system is easier to clean and most of the parts have a corrosion resistant coating to reduce the problem in the first place... In the meantime, I try to buy stainless weapons wherever possible since it provides some extra margin of protection, especially against condensation initiated corrosion since with the high humidity in the midwest that is a real problem with moving into and out of heated spaces every time you use the rifle.