Preheat oven to 350 degrees. On a rimmed baking sheet, roast nuts until golden, 12 to 15 minutes. Line another baking sheet with parchment paper; set aside.
In a large skillet, heat butter, sugar, and rosemary over medium-high. Add nuts; stir until butter mixture is golden brown, 3 to 5 minutes.
Spread nuts on prepared baking sheet; season with salt. Cool to room temperature, tossing occasionally, about 15 minutes.