Given a def id this checks if the parent def id (modulo modules) correspond to
the def id of the parent impl definition (the direct one and the outermost one).
Given a path, this checks if the if the parent resolution def id corresponds to
the def id of the parent impl definition (the direct one and the outermost one).