rustdoc: Do not deduplicate items when their parents differ.

Fixes #17332.