Can it be legal to use, or threaten to use, nuclear weapons?

Russia’s president has raised the prospect of using nuclear weapons in Ukraine. That’s a frightful notion. But it might not violate international law.