Preheat your oven to 350°F (175°C).
Spread the walnut halves in a single layer on an ungreased baking sheet.
Toast the walnuts for 8–10 minutes.
Keep a close eye on them during the last few minutes to prevent them from burning.
A few minutes before the nuts are done toasting, melt the butter in a frying pan over low heat.
Add the raw sugar and stir continuously until it dissolves.
Stir in the five-spice powder until it's fragrant and fully combined with the butter and sugar mixture.
Carefully add the hot, toasted walnuts directly from the oven into the pan.
Stir quickly to coat every nut evenly.
Continue to cook for another minute until the glaze thickens and is nearly absorbed.
Pour the coated walnuts back onto the baking sheet. Use a spatula to separate them into a single layer and let them cool completely to harden.
Work quickly when coating the nuts in the glaze, as the sugar mixture will harden fast once it's off the heat.