Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Remove some bad link warnings #1161

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

harpocrates
Copy link
Collaborator

Fixes #1070, using the approach in #1070 (comment).

  • fb91c0f: Haddock has no business renaming (or doing anything) with docstrings that will never make it to any output, so we prune them early. No more warnings about anything in private docstrings!

  • 4e28b14: Minimal signatures no longer cause renaming warnings. Since showing the un-exported symbol is intentional, we shouldn't warn on it.

/cc @guibou

When first creating a Haddock interface, trim `ifaceDocMap` and
`ifaceArgMap` to not include docstrings that can never appear in the
final output. Besides checking with GHC which names are exported, we
also need to keep all the docs attached to instance declarations (it is
much tougher to detect when an instance is fully private).

This change means:

  * slightly smaller interface files (7% reduction on boot libs)
  * slightly less work to do processing docstrings that aren't used
  * no warnings in Haddock's output about private docstrings (see haskell#1070)

I've tested manually that this does not affect any of the boot library
generated docs (the only change in output was some small re-ordering in
a handful of instance lists). This should mean no docstrings have been
incorrectly dropped.
When renaming the Haddock interface, never emit warnings when renaming a
minimal signature. Also added some documention around `renameInterface`.

Minimal signatures intentionally include references to potentially
un-exported methods (see the discussion in haskell#330), so it is expected
that they will not always have a link destination. On the principle
that warnings should always be resolvable, this shouldn't produce a
warning. See haskell#1070.
@harpocrates harpocrates merged commit 83f0fa0 into haskell:ghc-8.10 Apr 15, 2020
@harpocrates harpocrates deleted the feature/less-bad-warnings branch April 15, 2020 14:30
@guibou
Copy link
Contributor

guibou commented Apr 15, 2020

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not warn about private link to private symbols
2 participants