In this post, Roko makes some simple estimates to conclude that there are not really any physical/material constraints on humanities' growth until about 10 trillion people.
Personal rumbling
That paints a different view of the future than I had in mind intuitively. Perhaps humanity could mostly solve resource scarcity within ~50-100 years and allow for rapid population growth (say, enforced by local governments for some reason [like trying to game global democracy, if I'm already painting one specific and weird future]). This type of thinking might put a big value on the not-so-far future, which potentially could be addressed by interventions other than advocated for in longtermism (say, advocate for medium-term (~100 years) contracts/policies, something about global warming, improved population policies).
This misses senses in which resources can run out.
Simplestly, there's locked-in-use. Consider Rhenium. It's about 1ppb in Earth's crust and about 1000 tonnes of it have been refined in all of history. How much can be produced without implausibly destructive mining techniques is hard to estimate. It's essentially indestructable and uncreateable. It's used in jet engines and other high-temperature high-pressure applications. The number of jet engines in service at any time is bounded by available Rhenium. After that limit, new engines can only be made by melting down old ones. If you try to stick a trillion people on Earth, the jet/person ratio may get awfully low.
A more subtle locked-when-in-use resource is surface area. Especially temperate land surface. It can either be providing humans with psychologically-needed sky access or be covered in solar panels. (Or be used for agriculture or left as wilderness for other species, but in the extreme case those will be abandoned as inefficient.)
Another failure mode is that we may fail to solve the technological problems in using resources so efficiently. I mentioned above that agriculture was an inefficient way of converting sunlight and CHON into consumable food. But if we replace it with photovoltic cells and chemical plants, we risk missing a vital micronutrient and suffering widespread health issues.
A subtler version of this is failing to solve the social problems. Imagine living in Alberta Canada in a world where electricity comes from a solar plant thousands of miles to the south and water from a desalinization plant thousands of miles to the west. And if either breaks down even briefly you and your neighbors all die. Likewise if anything goes wrong in the transmission systems anywhere along the route. Can we run infrastructure that reliably? Can we prevent terrorism in such a situation? Can we cope with the problems caused by the solutions to the preceding problems?
More concerning than jet engines might be the high efficiency natural gas turbines for generating electricity. However, it looks like Ruthenium is even better than Rhenium for these applications. And in general, you can avoid rare earth metals and just accept slightly lower performance for combustion turbines, wind turbines, electric car motors, LED lights, solar cells, etc.