In a medium saucepan, whisk together the sugar, cornstarch, and salt.
In a separate bowl, beat the egg yolks. Add milk - a bit at a time - whisking until well combined. Add this mixture to the pot, whisking to fully combine.
Once everything is fully combined - and being careful to scrape the bottom of the pan - bring to a just to a boil over medium-high heat, whisking constantly.
As the mixture starts to boil, turn heat down to low and continue to simmer until quite thick. Remove from heat.
Immediately add the chocolate, butter, and vanilla. Whisk constantly until the chocolate and butter are completely melted and everything is well incorporated.
Pour into the cooled pie crust, using an offset spatula or the back of a spoon to smooth and flatten the top of the filling.
Cover with plastic wrap - right against the surface of the filling - and chill for 8 hours.