In a medium saucepan, stir or whisk together the sugar, cornstarch, and salt.
Pour in the milk and egg yolks, whisking to combine.
Stir over medium heat until the mixture just barely comes to a boil and becomes thick, about 6 to 8 minutes.
The second it starts to bubble and thicken, remove it from the heat.
Add the chocolate, vanilla, and butter, and stir until everything is beautifully combined.
Pour the pudding into the pie crust and place in the fridge, uncovered, to chill for 4 hours.
Cut it into slices and serve with whipped cream!
