These are a couple of thousand years old, at the least: Greek swords in a Cretan museum.
All equipment, designed by professionals, is designed to a lifetime. I would say firearms are designed to a finite number of firing cycles, which for rifles is typically 5000 rounds. The typical barrel is toast around 5000 rounds. You can find on the web a thread where posters were asked how many rounds their AR's went through before the bolt cracked, and a good starting average was around 10,000 rounds. I have been told that some bolts made of more expensive materials and shot peening are expected to last 30,000 rounds before lugs crack. These bolts are failing through fatigue failure. A designer looks at the maximum load, and looks at the maximum stresses on the part, examines fatigue lifetime charts, and makes sure that the fatigue lifetime of the bolt is within lifetime requirements. If loads are increased above maximum design levels the bolt will crack sooner. Bridges are falling all around us. They were designed for a maximum truck weight, which used to be around 40,000 lbs, in the 1980's semi's were allowed to tow 80,000 lb, with some 100,000 lbs. Also, the number of vehicles passing over each day was assumed to be in the thousands. Today, hundreds of thousands of vehicles are passing over those same bridges and at a much greater weight than they were ever designed, so the bridges eventually fatigue fracture and fall down. Oops!: This was in Genoa Italy. I recommend, never live under a bridge.
The US Army standard for endurance testing of small arms is 6000 rounds and at the end of that, the weapon is sent back to depot where any if not all parts can be replaced in a rebuild. A bud who worked on a rebuild line told me that rebuilt M16's/M4's routinely completed a 6000 round endurance test without failures, which shows the maturity of the design. Something that developed more energy, such as 308 Win mechanism, in the M14, a Watertown Arsenal report made the claim that receivers and bolts were failing around 5000 rounds. I have seen M1a receivers that went through multiple barrels, more than three, memory is not working, and the receiver had a crack on the left, under the elevation knob. I have a M1a with a new receiver, its receiver cracked first barrel.
A shooting bud, who worked on Naval five inch cannons, claimed the life expectancy of a 5 inch barrel was 700-800 rounds. The tube was tossed after that. I was told everything, carriage, locking mechanism, tube, on a 155mm was tossed after 15,000 rounds.
I found from a cannon book, that the average life expectancy of a Civil War Parrot gun was 300 rounds. Around shot 300 the barrel would blow and kill the entire crew, and anyone around.
Not a Parrot gun:
During the siege of Mobil, Farragut lost more men to Parrot gun explosions on his ships, than he lost to Confederate counter-battery fire.
I believe more firearms are rusted out than fired out. Steel is the primary material used in locking mechanisms, if steel is not protected from oxygen, it will rust. I have seen ferric materials deteriorate in a matter of weeks, to rusted uselessness, in a matter of months, in a coastal salt air environment. Similarly, we see all the time old cap and ball weapons picked up in desert environments in relic condition. The things must have been on the ground for a century. Plastic, which is common, deteriorates and AR15's typically have lots of plastic. I have no idea of the shelf life of modern plastics. I think the lifetime of plastics would be determined by heat, sunlight, and whatever nasty chemicals were not removed in the polymerization process.
Springs will take a set, I have replaced almost all of my mainsprings in vintage WW1 and WW2 era bolt action rifles. These are under continual stress being compressed and over time, loose their strength.
This M46 recoil spring was the original 1968 spring and I only replaced it a few years ago
The shooting community expects to live forever and therefore expects its firearms and ammunition to also last forever. If weapons are kept from rusting, are not fired to the point of fatigue failure, there is no reason they should not out last their owners.
Lets start a rumor that the next Democratic President will pass a law that makes primers dud out within five years. It has been 20 years since the Clinton primer scare, surely we need to revive it.