rust-lang/rust — pull request #19690 by barosl (2014-12-10 07:39:03+00:00)
Title: [WIP] Fix an ICE when trying to resolve a struct variant

Unlike a tuple variant constructor which can be called as a function, a struct variant constructor is not a function, so cannot be called.

If the user tries to assign the constructor to a variable, an ICE occurs, because there is no way to use it as a function. So we should stop the constructor from being used like that.

A similar mechanism already exists for a normal struct, as it prohibits a struct from being resolved. This commit does the same for a struct variant.

This commit also includes some changes to the existing tests.

Fixes #14302.