Removes the phosphate from trehalose 6-phosphate to produce free trehalose. alpha,alpha-trehalose 6-phosphate + H2O = alpha,alpha-trehalose + phosphate Glycan biosynthesis; trehalose biosynthesis. Belongs to the trehalose phosphatase family.