Oh, definitely. I've had depression and anxiety as long as I can remember, and once the angst of adolescence set in on top of it I withdrew from my friends and social groups and began maladaptive daydreaming, which is basically writing mental novels where you 'become' the characters for hours at a time, just sitting staring into the middle distance and are completely immersed in your inner world.
My characters were as fucked-up as I was, and my depressed mind turned to heroin as the stereotypical ultimate escape and a great drama for the plot, so I started spending tons of time on the computer doing 'research' for my story. It started with heroin on erowid, bluelight, etc., and then my nerd side kicked in and for the rest of high school, learning about drugs--from chemistry and neurobiology to drug culture and influence on society--on internet sites became my hobby. And like Tryptamine*Dreamer, I of course also researched lethal doses of drugs as a form of suicidal ideation. (I also researched drugs for mental illness, but that was more vetting my options for potential meds if I ever got the guts to seek treatment.)
I was too much a loner to know how to find drugs in high school, but Pandora's box had been opened and there was no reversing my curiosity, so as soon as I got to college I did ALL THE DRUGS! for the first few years, starting with innocuous psychedelics but ultimately finding my way to the hedonistic and dangerous drugs my young depressed self most craved: oxy, heroin, dillies, meth.
Long story short, I also started having manic episodes in college and was finally properly diagnosed and treated for bipolar and anxiety. And FWIW, since my depression has lifted and I have greater control over my emotions, I no longer feel the need to DO ALL THE DRUGS, and even the stupid heroin/ice addictions I've picked up along this dark path are really losing their luster. I got clean for 4 months then relapsed a month ago--but I'm remembering now how awesome sobriety is, not being chained to a substance to feel happy and having your whole life revolve around it, and I really want to clean up for good.