A friend baked a rum cake for me. She baked it in an aluminum pan. The cake was soaking in rum. Overnight the cake turned BLACK. I suspect this is a chemical reaction, but cannot find information to back my theory. Surely, this may not be safe to eat. Anybody?
This is an interesting question. Personally I would throw it out, the discoloration and resulting taste are the result of a chemical reaction with the pan.
The brownish discoloration is a sign that the Aluminium (Al, the chemical symbol for the element from here on), is being attacked by a chemical reaction. This is most likely by an acid, though salts can also cause this to happen. In both cases what is happening is that the Al is being converted into the cation Al3+. Al3+ is bio-available and considered to be the main source of Al toxicity in humans. Acute Al toxicity results in non-specific symptoms, like confusion, muscle weakness, and bone pain, however normal exposure is not considered harmful. Not a lot of long-term data has been produced, but there are potential links to things like Alzheimer's disease, and breast cancer.
The European Food Safety Authority has a limit of 1 mg/kg of body weight/week for intake from foods. This paper suggests in passing that some people are often at or beyond the EFSA limit, but this might not result in any problems, also mentioned in that paper is that the WHO has a provisional limit of 2 mg/kg/week.
Now, as to how much of the Al has dissolved into your cake, and how much you are ingesting if you ate the whole cake is impossible to estimate without measuring the Al content of the cake and syrup. Generally you will be able to taste the metallic taste of Al and other metals when they dissolve to this sort of level, though in this case, the already strong taste of rum might well overpower the metallic taste.
Aluminum cookware is "reactive", as opposed to "non-reactive" cookware like glass or stainless steel. When cooking acidic ingredients, a reaction occurs that can discolor food and sometimes leave a taste of tin. It would appear that the rum cake in question was acidic enough to cause this reaction. While I have yet to come across anything that says this is dangerous, I have come across several discussions that say aluminum discolored food is "ruined."
It is unlikely but possible that it is unsafe to eat. This study of aluminum leaching from pans during cooking of acidic liquids (https://www.ncbi.nlm.nih.gov/pubmed/1397396) showed a levels as high as about 50mg/kg. Let's assume your cake is about 1kg, so 50mg aluminum. The European Food Safety guideline for aluminum according to this paper (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5651828/) is 1mg/kg/week. So if you weigh only 50kg and you eat the whole cake in a week and it really leached about the most aluminum seen, you're up against that limit.
But probably not, since the average human weighs more than that, the rate of leaching should be much lower at room temperature, the limits are for chronic intake and anyway WHO thinks you can tolerate twice as much.
Also, from the second paper: "The acute toxicity of aluminum is low. No acute effects due to dietary exposure to aluminum have been observed in the general population."