Over many years, I've inspected used rifle bores and never found rust or any corrosion in any .22LR rifle bore. That doesn't mean that they don't get cruddy, but the wax on each bullet fired coats the bore to prevent moisture from getting to it. Barn rifles may look like they were badly abused and be rusty on the outside, but rimfires I've examined have rust-free bores, if left dirty.
However, centerfire rifles shot with copper jacketed bullets, left unclean and in gunstore racks have often exhibited rusty bores. In young adulthood, I was guilty of leaving my woodchuck rifle all summer/early winter without cleaning, after the spring season. That resulted in severe rusting/pitting. I had to soak the bore in oil for several days before a cleaning rod could go through. Never again would I ever "let the sun set on a dirty gun"!