I am aware that many UK PhD studentships are only open to UK/EU applicants (question 1, question 2). In my understanding, they cannot (pre-Brexit) legally discriminate between EU and UK applicants, but they can bar non-EU applicants. But my eyes fell upon eligibility requirements for this University of Newcastle PhD studentship, emphasis and link mine, which effectively bars EU applicants, too:
This studentship is available to UK applicants and EU applicants with settled status in the UK, meaning they have no restrictions on how long they can stay. All eligible applicants must also have been ‘ordinarily resident’ in the UK for 3 years prior to the start of the studentship, and not been residing in the UK wholly or mainly for the purpose of full-time education.
Such an additional requirement effectively discriminates between UK and EU applicants. The vast majority of EU applicants will not have been also resident in the UK for 3 years prior to the start of the studentship, or if they have, have been so for the purposes of education. Even some UK citizens will be ineligible if they spent any time studying abroad.
Is such discrimination between UK and EU applicants legal under EU law? It would appear to effectively amount to the same as stating "Europeans need not apply" by different means.