Elections market-test the appeal of ideas. Thanks to Donald Trump, this election is market-testing the idea of anti-immigration restrictionism. And if polling trends hold, this idea will be a big loser on Nov. 8.

Trump has wavered on many things, but not on his obnoxious anti-immigration stance. In fact, as Cato Institute's Alex Nowrasteh notes, Trump is the "dream candidate" of America's anti-immigration faction. He took the substance of his platform from the Center for Immigration Studies, among the nation's chief nativist outfits, and National Review Online — and he boasts the bombastic presentational style of Ann Coulter. CIS's Mark Krikorian, a regular contributor to NRO, has opined that no other candidate "has as sound and as well thought-through an immigration plan" as Trump. And Coulter, with typical restraint, has called Trump's plan the "greatest political document since the Magna Carta."

Their enthusiasm for Trump is understandable. Other than a few disagreements on whether undocumented immigrants should be mass deported by Uncle Sam or forced to self-deport via harsh interior enforcement, Trump's immigration plan is exactly what NRO and CIS have pushed for years. Trump opposes "amnesty" of any kind. So do they. Trump wants to build a "big beautiful wall" on America's southern border. So do they. Trump wants a surge in the already "surged" border enforcement. So do they. Trump thinks that the Syrian refugee program is a Trojan horse for ISIS and should be scrapped. So do they. Trump wants to significantly limit family-based immigration. So do they. Trump wants to cut back on legal foreign workers because they allegedly threaten American jobs and wages. So do they. Trump wants to end birthright citizenship. So do they. And on and on and on.

Unfortunately for Republicans, this restrictionist warpath is a surefire road to political self-annihilation for two reasons: It is counter to how American public opinion is trending (as I wrote last week), and it alienates Latinos, without whom it is not possible to win, as Mitt Romney learned the hard way in 2012. Indeed, polls conducted last year by Burning Glass Consulting's Katie Packer, Romney's political consultant, found that restrictionism yields very small positives for candidates in the primary and very large negatives in the general. How large? A restrictionist candidate loses 24 percent more voters than he attracts in swing states.

Restrictionists have pooh-poohed such suggestions on the theory that there are seven million missing white voters waiting to be tapped by a candidate with the right talent for immigration bashing — at least for the next few election cycles before the rising Latino and other minority populations make whites a demographic plurality.

Trump's candidacy is shaping up to be a living refutation of that argument.

To be sure, his message has resonated in Iowa, where he is ahead by a few points even though Obama won that state in 2012. Also, Ohio, a toss-up state, is now tipping in his direction, after voting for Obama in 2012. And no doubt, Trump's nativism has turned many Southern states a deeper shade of red.

But none of this compares to the eye-popping developments in Utah, a state where Trump has whittled Romney's 48-point victory margin in 2012 to a pathetic 2 to 3 points. Romney is Mormon — but Utah hasn't given the GOP less than a 20-point edge since 1996. Part of Utah's reversal no doubt has to do with Trump's loutish and lewd behavior, which the Beehive State's socially conservative Mormons find deeply offensive. But Utah is also generally pro-immigration — even its Republican lawmakers openly support a path to legalization. They've even explored ways to hire undocumented workers fleeing Arizona's hostile climes, and are spooked by Trump's calls for a ban on Muslim immigrants.

Less dramatic than Utah — but equally remarkable — are Texas and Arizona. The Republican margin has shrunk considerably in the Lone Star Sate, and it is on the verge of going blue. Although Arizona has been at the vanguard of the nativist movement, it isn't responding to Trump, thanks to the state's growing Latino clout. Indeed, for the first time in 20 years, the Grand Canyon State is giving a slight edge to a Democrat in a presidential election.

But the truly telling development in Arizona is in the race involving Sheriff Joe Arpaio in Maricopa County. For 23 years, he has been terrorizing the Latino community through illegal racial profiling. Trump wears Arpaio's endorsement like a badge of honor. But the sheriff is 15 points behind for a seat that he won by 40 points in 2000. Meanwhile, Republican Sen. John McCain has opened a 15-point lead over his Democratic rival — after breaking ranks with Trump's harsh anti-immigration talk and unendorsing him.

Nevada and North Carolina are also flipping — or close to flipping — from red to blue, and for many of the same reasons.

With the exception of Iowa and maybe Ohio, it is hard to think of any swing state where Trump's anti-immigration rhetoric will provide a November boon for Republicans. It has, however, put them on track to lose four or more swing states. There is no doubt that Trumpism is pushing America's growing number of Latino voters ever more into the arms of Democrats.

NRO and CIS may try and explain away the election results as a repudiation not of their restrictionist message but the ugly messenger. What the GOP needs is a spokesperson who is pro-immigrant but against immigration, as CIS puts it.

But you can't put a pretty face on restrictionism. You cannot attack immigration as harmful and then embrace immigrants as awesome. Inevitably, some ugly demagogue like Trump will swoop in and expose the others as insincere double-talkers by taking a more consistent position.

The GOP's choice going forward will be to stick to the intellectually and politically bankrupt nativist path that the casino magnate has put them on, or reverse course completely and return to Ronald Reagan's sunny view of immigration. There is no middle ground.