Sweets aren't the only foods that cause tooth decay. Starchy foods are usually somewhere around the scene of the crime. They turn into sugar right away because the mouth begins the pre-digestion process through the enzymes in saliva. Also, some starchy foods like potato chips and popcorn can become lodged in between teeth and in tooth crevices, contributing to plaque. Most people don't floss or brush right immediately after eating, so the plaque that causes tooth decay has ample opportunity to start forming, according to the Mayo Clinic.
Once again, no one is suggesting that you give up on macaroni and cheese and pasta rigatoni. It's much better for your teeth if you eat starches as part of your meal when you have a greater chance of brushing your teeth afterwards. If you do have to snack, choose foods like fresh fruits, vegetables, cheese and nuts.