I've seen it done that way. I've done renovations in my various homes in the past. I would not do it that way. The carpet does not have to be ripped up and replaced. The part that will be covered by the wall can be cut out. Then carpet tack needs to be placed next to the wall and then tightened to it. HTH