Zoezys gram's answer seems to cover your question.
Since you seem to care, a little more information might help, though.
'Autistic' isn't a single thing with the same 'symptoms' for everyone, therefore the 'Autistic Spectrum' (Disorder, that is) - varying from someone who cannot live without constant care, to someone such as your friend, usually referred to as 'high-functioning'. In my case, 'high-functioning' didn't prevent me from sowing 'social' chaos and disorder as I stumbled forth, particularly at a time when autism wasn't generally known.
Therefore, being 'autistic' (and also Linux-obsessive, I might add) physical contact for me is just the opposite - I don't allow even handshakes. The only two people who were ever allowed to touch me without being strictly reprimanded, were my father and my (not much less autistic than I) identical twin brother. Since birth we've been tangled up in each other whenever possible (and sometimes even when not), and we've even slept together until he died when we were eighteen. My brother, however, was exactly as you describe your friend - and both of us had to learn quite a range of lessons to be able to sort of operate amongst neurotypicals. Happily for him, he had me to 'cuddle' - and happily for me, I had him to 'cuddle' me.
One rather common characteristic of autistic people, is sensory issues - of which I have quite a number. Some (most, even) of those are things which commonly happen in everyday life (such as almost all noises, bright light and temperature variation), but which I find quite difficult and even unable to deal with. On the other hand, autistic people very often crave certain stimulation (as I will not ever get used to not having my brother physically with me - the genetic thing exacerbated logarithmically by the autism thing); you can quite easily 'Google' for autistic 'stimming' ('stimming' = self-stimulation / self-calming etc.) to understand what it's about. Something else which autistic people often crave, is physical pressure - you can easily read up the specialist on this issue, Temple Grandin. The description of your friend's behaviour, contains both 'stimming' and a craving for pressure. It's perhaps possible that he's not even specifically 'conscious' of his behaviour - for example his rubbing might have far more to do with the delightful feeling of the texture of your clothes' fabric under his fingers than actually stroking another human being.
HOWEVER - since he has been diagnosed as being on the spectrum, it's difficult to think that he hasn't had any sort of 'training' or whatever in terms of how to 'behave' - the Internet is almost literally choked with stuff about ASD and sources of help. I've been involved with quite a few autistic children and young grown-ups and very rarely have I known about someone the age of your friend - except perhaps if undiagnosed and unaware of the condition - who would exhibit the sort of conduct that you describe: specifically since it's unsolicited and unwanted.
Simply because the bloke is autistic, doesn't mean that you have to put up with his behaviour. Because of autism, I'll always experience the world as a sixteen year old; and because of this, children (especially the autistic ones I have contact with) are usually quite interested in interacting with me, including physically, which I allow them, however difficult. One reason it's possible for me to cope with it, is that it's the only human contact I have since my brother and father died - and the loss of their physical presence actually left a huge void. That doesn't mean that I've not very specifically learnt to be always absolutely vigilant every moment about not even coming close to the verge of anything that might have the slightest detrimental effect - particularly being a rather unusual playmate on the far side of fifty years old and unmarried, at that.
Without wanting to sound alarmist, at all, I think it's not outside the realm of possibility, though, autistic or not, that your friend's 'affections' might not wholly be as 'innocent' as they seem.
It would be insightful to know whether you are yourself a male, or female.
Anyway, my basic rule is that my body is mine to allow whatever I want to, and disallow whatever I want to. Simply because a societal rule determines / expects something (such as being courteous / accommodating / indulgent come what may), doesn't make it applicable to me and not to you, either.
Finding out almost everything about autism, is as simple as surfing the Internet; just beware of the plethora of idiots who think / pretend to know what they're talking about. Credible sources are abundant.