Assigning x in verilog
Such an assignment is useful during simulation, to make the waveform plots a little clearer.

Most synthesis tools will simply ignore any assignment to x. YMMV.

Assigning z to an external pin can be used to denote a tristate driver, but most FPGAs have limited, if any, support for internal tristate buses.