Nightshade. Reminds me of a story, probably apocryphal, of men trying to poison George Washington by putting a new “vegetable,” nightshade, into his salad. He asked for more. The Nightshade was what we call a tomato. Yes, the nightshades are related to the tomato. Reading tells me that the black berry is fine and edible. I’ve tried it. I’ve seen birds (chukar) eating it. If it is toxic at all it is when it is green.
Notice that the sepals curl away from the flower and fruit.
The nightshades grow on the prairie, but when they get moisture, as this plant at the river, they can do very well.