Pastry dishes became very popular in the Middle Ages and Tudor eras. There are many recipes for both sweet and savoury fillings baked in pie crusts or 'coffins'. The filling was often eaten from the baked pastry dish and then the pastry was thrown away. The pastry served as the baking tin and wasn't necessarily part of the meal.
There is much debate about the origin of the Cornish pasty. It is commonly held that they were made for Cornish tin miners as their midday meal. Tin is very poisonous and it is thought that the crust was held along its edge, while the sweet and savoury filling was eaten. The tin covered edges could then be thrown away, keeping the miners safe from tin poisoning.