You cannot mix-and-match rifle and pistol lowers with different uppers. That is, the pistol has to be built on a pistol lower. I don't know how you can tell them apart, unless lowers for pistols have to be stamped "pistol", somewhere? Putting a short-barreled upper on your rifle lower would be the same as cutting the barrel below the minimum legal limit for rifles. There is nothing physically preventing you from doing it, though.