Heat oven to 375° F.
Melt the butter in a medium skillet over medium heat. Stir in the sugar, cayenne pepper, and kosher salt. Add the pecan halves and toss. Transfer to a baking sheet and bake, stirring occasionally, until toasted, about 12 minutes. Add the rosemary and toss to combine. Transfer to a bowl and serve warm or at room temperature.