You don’t sweep the carpet (or rug); you lift up a corner of it and sweep dust or dirt under the carpet. You hide the dust or dirt under the carpet so that you don’t see it and can ignore it.
Sweeping a problem under the carpet means ignoring it, pretending it doesn’t exist.