Unless the professor leaked some amount of information that could make the student easily identifiable, I don't think there is anything that can be done (at least for US universities).
This answer is bound to be unpopular, but I personally wouldn't view this as a bad thing from the student's perspective (although I can fully sympathize with the student being taken aback). The student is getting direct feedback from the professor and potentially the class, and is likely going to be getting much more feedback than the typical scribbles most professors leave in the margins while grading. This potentially opens a window for increased learning and growth due to receiving additional, detailed feedback. It is also reasonable practice for receiving feedback during committee meetings or a department-wide presentation.
While this may not have been handled well, at all the universities I have been affiliated with, this kind of practice is 100% fair game (including without prior notice).
What the Professor Could Have Done Better
In general, it is a common courtesy to let students know if their work is going to be publicly discussed during class. At a bare minimum, the professor should have mentioned in the syllabus that assignments may be used for anonymous, public critique. Most preferably, this should have been announced during the first day of class. I have also found that when students know their work may be made public, they tend to put more effort into assignments, so knowing ahead of time is beneficial.
What the student could consider doing
If the student is comfortable doing so, I would recommend emailing the professor or talking with them privately during office hours. Depending on how the student feels, I would recommend saying something along the lines of:
a) "I appreciate the direct feedback I received in class, but having my work made public without notice made me pretty uncomfortable. Could you give me advanced notice next time you are planning to use one of my assignments?"
b) "I appreciate the direct feedback I received in class, but having my work made public without notice made me pretty uncomfortable. Would it be possible for you not to use any of my future assignments publicly? If I have made some serious mistakes I would rather discuss it with you privately during office hours then have them displayed publicly to the class."
Hopefully the professor is a reasonable person who does not intentionally want to make students highly uncomfortable. If the professor is doing so unknowingly, I think it is better for them to hear from a student personally rather than as a negative anonymous review after the semester is already over.
As long as the professor does not feel attacked or accused when approached by the student, I think there is a good chance they will be open to considering the student's feedback.