Actually not illegal technically as the receiver has his right to his route. And you must not watch very much football
because this play happens 20 times every game in both NCAA and NFL. Short yardage situations/redzone and this play will for sure be called at least once in the series. Almost never flagged unless the rub is a blatant block.