When robots can make other robots like themselves using only raw materials, we’re in trouble. Probably before then, but this means they don’t even need us anymore.
Yup—those were the Van Neumann machines.
https://en.wikipedia.org/wiki/Self-replicating_machine
They are an excellent way for a sentient species to spread itself throughout a galaxy without risk to biological beings:
https://en.wikipedia.org/wiki/Self-replicating_spacecraft#Von_Neumann_probes