In the last few years the possibility of constraining dark matter with astrophysical observations of compact objects, such as white dwarfs, neutron stars and black holes, has been explored. The ultra-high density interior of neutron stars and the strong-curvature regions near massive black holes make these objects unique laboratories to test weakly-interacting particles. In the first part of this talk I will review some recent work on the potential of compact objects as dark-matter detectors, including the consequences of dark-matter accretion on compact stars and superradiant black-hole instabilities triggered by ultralight bosons. In the second part I will discus how observations of neutron stars can be used to constrain the dark-matter fraction in primordial black holes. In a close encounter with a neutron star, a primordial black hole can get gravitationally captured due to accretion, dynamical friction and tidal heating. Within a short time, the black hole is trapped inside the star and disrupts it by rapid accretion. The mere existence of old neutron stars limits the abundance of primordial black holes in the only mass range that was still unconstrained, thus suggesting that these objects cannot be the dominant dark matter constituent.