To the best of my knowledge no immigration authority will pass anyone without (first) a valid passport and (second) a valid visa where required. No visa is valid in an expired passport so if you need and have a visa for staying in the UK then it too will be invalid by definition. However, what should put everything right is if you have the Turkish embassy issue you a new passport which you then present to the UK authorities for transferring the visa. As there are no immigration formalities on departure from Britain the only snag you might find in leaving on an invalid passport is if the airline refuses to check you in (possible). How you go about entering Turkey is between you and them. Then you would likely have to apply to enter the UK from the beginning again. If you have overstayed on the visa, then you would likely face serious obstacles.