AFP/Getty Images U.S. President Donald Trump speaks after touring Snap-On Tools in Kenosha, Wisconsin, April 18, 2017, prior to signing the Buy American, Hire American Executive Order.

U.S. President Donald Trump's anti-immigration stance threatens the U.S.'s dominance in the tech sector, but it could be a big boost for Canada, which is struggling with its own tech-worker shortage. According to a new survey from employment site Hired, Canada is the leading choice for STEM workers looking to leave the United States. The survey of tech workers who are part of Hired's platform found 40 per cent said they have considered relocating to outside the U.S. since Trump was elected. Of those, nearly a third — 32 per cent — prefer Canada. Germany is the second most popular destination at 12 per cent, followed by Australia and Asia at 10 per cent each.

In his first month of office, Trump issued an executive order banning travel from several Muslim-majority countries. Though that order was overturned by the courts, a second version was partly approved by the U.S. Supreme Court, and is in place until a final hearing in October. Trump also signed an executive order called "Hire American, Buy American," which calls for a reduction in the number of H1-B visas the U.S. issues. The visas are the primary way by which tech companies bring foreign talent to the country. "Combined with recently announced plans to eliminate a federal rule that lets foreign entrepreneurs come to the U.S. for the purposes of starting new companies, it all adds up to a troubling outlook for the US's ability to to retain talent and foster innovation," the Hired report stated. It cited research from last year showing that the U.S. will have be short 1.1 million STEM workers by 2024 — a problem that could be worsened if it becomes more difficult to bring new talent to the U.S. 'Canada is uniquely positioned': Innovation minister But what is a threat to the U.S.'s dominance of the industry is an opportunity for Canada. Successive governments have been working for years to attract Silicon Valley talent to Canada, including the introduction this past June of a "fast-track" visa for tech talent. "In a world where people are becoming more and more inward, where there is a rise in populism, there's a lot of Islamaphobia, a lot of xenophobia, there's a lot of anti-immigrant sentiment, Canada is uniquely positioned," innovation minister Navdeep Bains said last month. Learn about Donald Trump's proposal to slash the number of immigrants coming to the U.S.: