Many conjectures in number theory (most notably, the Cohen-Lenstra heuristics, their extensions by Cohen-Lenstra-Martinet, Bhargava's conjectures, and the inverse Galois problems) can be phrased in terms of the distribution of discriminants of extensions of number fields satisfying various conditions, including that of a specified Galois group. These problems seem difficult even when the number field is replaced by a rational function field. We discuss a "stable cohomology" conjecture in topology which would imply function- field versions of the above number-theoretic conjectures, and we describe progress towards this conjecture. (Joint work with Akshay Venkatesh and Craig Westerland.)