This letter explores the concept of non-coherent index modulation (IM) in a general setting from the standpoint of coding theory. In doing so, we establish a bijective mapping from the set of activation patterns of an IM system to the set of codewords of a binary block code. We show that a non-coherent IM system whose active indices are independently affected by additive white Gaussian noise and Rayleigh fading can achieve a diversity order of $t+1$ if its activation patterns follow a $t$ -error correcting code designed for a Z-channel. Activation codes employed for IM systems are either constant or variable-weight codes. Using a variable-weight code requires a slightly higher detection complexity, but it can result in a diversity order significantly higher than the maximum achievable diversity order of a constant-weight code.