I suspect with the older end of YA (say 14/15+) and an adult novel there's not much effective difference except in how it is marketed.
Someone mentioned Melvin Burgess - I've read Doing It and Lady: My Life as a Bitch and I don't think you can go any further with (hetero) sexual content in a YA novel.
Ordinary People (Judith Guest) was never to my knowledge published as YA but it certainly was read by a lot of teens and I believe it's taught in US schools nowadays. I read it at 16, around the time the film came out, and I wasn't the only one of my age to do so. The central character is a teenager who (before the novel starts) attempted suicide after his older brother died in an accident. There is strong language and (not explicit) sexual content. It's a novel that had a big impact on me at the time.
On a personal note, I had an agent for ten months with a novel which I was surprised to learn was a teenage novel. Well it did have two seventeen-year-olds as protags, but my reaction, naive as it was, was "This can't be teenage, it's got sex and swearing in it." The plot also hinges on a rape, of which one of the protags is the victim. It eventually was rejected and returned to me, but the content was never the problem. This was something like seventeen years ago.
So, I think the answer is - YA can be as dark as it needs to be, as long as it is still engaging/relevant to its readership. You may however end up with an "explicit content" or "not suitable for younger readers" on your cover, as is the case with Melvin Burgess and Aidan Chambers, amongst others.