Merge pull request #412 from dtolnay/sort

Perform topological sort of structs earlier during type checking