Prevent infinite recursion in rustdoc

Details in the commits.