I think your teacher may have made a typo. Refer to the diagram below. If we ignore segment ZA for now, we can see a rectangle forms with angle W = angle Y = 90. Also, we can see that WX = 6 is the horizontal base and WZ = 8 is the vertical height.
However, the side opposite WZ (which is XY) should also be 8 cm tall, and not 6 cm. If XY was 6 cm, then point Y would move to where point A is located (and the quadrilateral would be WXAZ instead of WXYZ). This new quadrilateral would not have a 90 degree angle at point Y's new location.
In other words, if we want angle Y to be 90 degrees, then side XY must be 8 units long. I have a feeling this is where the typo is, but your teacher might have been intending to say something else.