Removes the phosphate from trehalose 6-phosphate (Tre6P) to produce free trehalose. Also catalyzes the dephosphorylation of para-nitrophenyl phosphate (pNPP), but with lesser efficiency (in vitro). alpha,alpha-trehalose 6-phosphate + H2O = alpha,alpha-trehalose + phosphate kcat is 10 sec(-1) and 0.8 sec(-1) for Tre6P and pNPP, respectively (at pH 8 and 50 degrees Celsius). Glycan biosynthesis; trehalose biosynthesis. By Tre6P. Belongs to the trehalose phosphatase family.