In a medium heavy-bottomed saucepan, whisk the milk, rum, and flour.
Heat over medium heat, stirring continuously, until the mixture is smooth and thick. Stir in the sugar and vanilla. Set aside and let cool.
Meanwhile, beat the butter at medium speed until soft and fluffy, scraping down the sides of the bowl.
Beat in the cooled milk mixture, 1/3 at a time, beating well between each addition.
Use to fill and frost a cake, like the easy one-bowl chocolate cake.