Sort trait bounds.

 Closes #6334