Any of the three main types of rocks ( igneous , sedimentary , and metamorphic rocks ) can melt into magma and cool into igneous rocks .
Metamorphic rock is heated and squeezed igneous or sedimentary rock .