It was used to hasten child birth from the 1700s to the 1800s, by causing violent contractions of the uterus. It has since been discovered to be very dangerous and could be fatal.
Ergot is a fungus that attacks rye. Ergot poisoning causes mental frenzy, hallucinations, and convulsions. Ergotism causing hysteria due to eating infected rye bread is one theory behind the Salem witch hunt. It was discovered to contains lysergic acid, from which LSD (powerful hallucinogen) is derived.