In a large saucepan over medium heat, whisk together milk, sugar, cornstarch, egg yolks, and salt. Continue to cook over medium heat, whisking, until thickened, 7 to 8 minutes. Whisk in chopped chocolate and butter.
Pour mixture into the piecrust. Chill until firm, 4 to 5 hours. Before serving, whip heavy cream; top the pie with the whipped cream and shaved chocolate.