In a large saucepan, combine the sugar, cornstarch, cocoa and salt. Stir in milk until smooth. Bring to a boil over medium heat; cook and stir for 2 minutes or until thickened (mixture will thicken quickly). Remove from the heat.
Add chopped candy bars and vanilla; stir until chocolate is melted. Pour into pie shell. Press plastic wrap onto filling. Refrigerate until set, about 4 hours. Remove plastic wrap. Slice and serve with whipped cream.