https://twitter.com/luis_in_brief/status/1410242882523459585...
And this is a longer article about how IP and AI interact:
https://ilr.law.uiowa.edu/print/volume-101-issue-2/copyright...
I am not a lawyer, but I am capable of summarizing the thoughts of lawyers, so my take is that in general, fair use allows AI to be trained on copyrighted material, and humans who use this AI are not responsible for minor copyright infringement that happens accidentally as a result. However, this has not been tested in court in detail, so the consensus could change, and if you were extremely risk-averse you might want to avoid Copilot.
A key quote from the second link:
Copyright has concluded that reading by robots doesn’t count. Infringement is for humans only; when computers do it, it’s fair use.
Personally, I think law should allow Copilot. As a human, I am allowed to read copyrighted code and learn from it. An AI should be allowed to do the same thing. And nobody cares if my ten-line "how to invert a binary tree" snippet is the same as someone else's. Nobody is really being hurt when a new tool makes it easier to copy little bits of code from the internet.