According to Matthew Walker (Berkeley researcher on sleep), it does affect sleep. See this small clip, starting at 2:14.
Alcohol in our system at bed time impacts sleep as well. We’re consciously at rest (or blacked out from over consumption if that is ones thing) but our body is busy metabolizing.
Poor signal, YouTube isn’t loading. Not sure if the clip is similar, but as I understand it recording a dream and restless sleep from metabolizing substances are separate processes.
Weed and alcohol specifically suppress REM sleep, where most of dreaming happens.
Suddenly stopping weed or alcohol leads to a REM rebound, and people experience very vivid dreams. This association suggests they were actually not dreaming much before.