The most important reason not to warn your son to stay away from the boy who bit him is that doing so makes it your son's responsibility to stay safe. It's not. (It's not the same as running into the street, where his own action is what puts him in danger.) He should be safe because biting is wrong and people should not do it. If you warned him to stay away, and he did not and got bitten again, it would be easy (and unfortunate) to blame him indirectly ("Why did you play with him? I told you to stay away from him.") This is called victim blaming, and it's a pretty natural - and very painful for the victim - reaction. You can't keep him safe, so you try to teach him to avoid getting hurt by someone else. From the link above:
Bullying is a common behavior among children—and too often the targets get blamed. Aim to validate the feelings and experience of the person who is being bullied, while keeping the responsibility for the bullying on the bully. Rather than blaming or shaming the victim, the targets of bullying need support, compassion, and the skills to respond effectively.
The approach you mention also doesn't teach your child anything positive that he might learn from the situation. I'm thinking resilience, forgiveness, empathy/compassion, emotional literacy, etc. My approach (after first calming down myself) would be to talk with my child, first about his feelings about being bitten. To do this, the child must have a basic (and growing) emotional vocabulary. "It hurt!" would likely be the first response, so some encouragement might be needed. If you haven't started teaching emotions yet, it's time to start.
You: How did you feel when (x) bit you?
Child: It hurt! It hurt a lot!
You: I'm so sorry you were hurt. It hurts to be bitten! (you provide compassion and support.) People should not bite, should they?
You: That's right, people should not bite. Were you afraid? (feeling word)
Child: a) Yes. (Talk about how it's ok to be afraid of being hurt.) (That's the opposite of another way to victim blame: telling him to "suck it up/it doesn't hurt that much/Don't let him see you're afraid/etc.) Child needs you to have his back emotionally. b) No... (praise him, or be glad for him.)
You: Did you feel unloved (feeling word)? (the actual feeling might be closer to disrespected, but that has to be taught in context.) If (partner) bit me, I would feel like (Partner) didn't love me, and that would hurts me inside!
You: (Looking at hand) Does it still hurt? (here's where resilience starts... In addition to feeling angry/sad/whatever, he can be glad it doesn't hurt anymore/the pain will be gone by tomorrow/whatever, and that pain is temporary. Even broken bones heal.)
You: Did (x) tell you he wanted your toy?
Child: He said, "Give me that!/whatever"
You: What might you have done? (child could tell x he'll be done with it in a few minutes/offer him something else/point out similar toy/whatever you think the child might be able to use in the future.) You: "Sometimes that works." (No responsibility/blame shifting. Just a suggestion. Teaches some ways to avoid getting bitten in the future)
To teach empathy/compassion: What do you think (x) was feeling right before he bit you? You had a toy he wanted, didn't you? (More feeling words: jealous/angry/frustrated/whatever.) Empathy is important, because your child will feel negative things sometimes as well, as everyone does. It's human. It's how we act when we feel those things that's important.
For forgiveness, you'll have to reach down yourself and examine your own feelings about forgiveness.
It doesn't all have to be done in one sitting. Some can be done during bath time, the next morning during breakfast, etc.
The most important things to remember: there are adults there to handle the situation. This removes any responsibility from your child. It is never your child's responsibility to avoid getting bitten. He deserves compassion.
There are times when avoiding someone is a good idea, but this isn't one of them.