Taylor Swift says she used to struggle with an eating disorder.

The 30-year-old debuted her new Netflix documentary Miss Americana at the Sundance Film Festival on Thursday (January 23), and viewers were shocked to learn that the film touched on such private subject matter.

Variety reports that the new documentary features a scene where the "Lover" singer is faced with numerous photographers as she walks out of her own front door. In a voiceover, she is heard saying, "it’s not good for me to see pictures of myself every day."

Swift admitted that she has seen photos of herself where she has thought that her stomach was too large, or photos that caused the media to question if she might be pregnant. She says these instances would trigger her "to just starve a little bit — just stop eating."

"I didn’t know if I was going to feel comfortable with talking about body image and talking about the stuff I’ve gone through in terms of how unhealthy that’s been for me — my relationship with food and all that over the years," she tells Variety in an interview. "But the way that Lana [Wilson, the film’s director] tells the story, it really makes sense."

"I’m not as articulate as I should be about this topic because there are so many people who could talk about it in a better way," Swift adds, "But all I know is my own experience. And my relationship with food was exactly the same psychology that I applied to everything else in my life: If I was given a pat on the head, I registered that as good. If I was given a punishment, I registered that as bad."

Swift also recalled a time when she was a teenager, when she was on the cover of a tabloid for the first time and the headline was "Pregnant at 18?" because of her outfit decision to wear something that didn't make her stomach look completely flat.

"So I'd just register that as a punishment," Swift admits.

When the country-pop megastar would do a photoshoot with a magazine, she felt like it was a "pat on the head" when she would fit into sample sizes of fashion, the clothes coming straight off a runway. "You register that enough times, and you just start to accommodate everything towards praise and punishment, including your own body," she confesses.

She never really wanted to open up about her struggle, and she says she's still uncomfortable speaking on it, "But in the context of every other thing that I was doing or not doing in my life, I think it makes sense [to have it in the film]."

Swift's Miss Americana documentary shows the difference between her slimmer look during her 1989 Tour compared to her 'healthier' body during her Reputation Tour. She says her stamina suffered greatly while on tour, when she was under-eating.

"I thought that I was supposed to feel like I was going to pass out at the end of a show, or in the middle of it," she remarked during one scene in the film. "Now I realize, no, if you eat food, have energy, get stronger, you can do all these shows and not feel (enervated)."

Swift seems healthier than ever and has now come to terms with "the fact that I’m a size 6 instead of a size double-zero."

See Taylor Swift on the Golden Globes Red Carpet: