Move orphan instance/rule warnings to typechecker/desugarer.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Thu, 1 Oct 2015 22:24:41 +0000 (15:24 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Thu, 8 Oct 2015 22:55:08 +0000 (15:55 -0700)
commit931d0a7d1cd296f8c2a6190a06a2d3dcc8996ac3
treeaae7530fdcdef2ae332a84d85ead11882941656d
parentf64f7c36ef9395da1cc7b686aaf1b019204cd0fc
Move orphan instance/rule warnings to typechecker/desugarer.

Summary:
Instead of doing these warnings at MkIface time, we do them
when we create the instances/rules in the typechecker/desugarer.

Emitting warnings for auto-generated instances was a pain
(since the specialization monad doesn't have the capacity
to emit warnings) so instead I just deprecated -fwarn-auto-orphans.
Auto rule orphans are pretty harmless anyway: they don't cause
interface files to be eagerly loaded in.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1297
13 files changed:
compiler/deSugar/Desugar.hs
compiler/deSugar/DsBinds.hs
compiler/iface/MkIface.hs
compiler/main/DynFlags.hs
compiler/main/HscMain.hs
compiler/specialise/Specialise.hs
compiler/typecheck/Inst.hs
compiler/typecheck/TcGenGenerics.hs
compiler/types/InstEnv.hs
docs/users_guide/using-warnings.rst
testsuite/tests/typecheck/should_compile/T4912.stderr
testsuite/tests/warnings/should_compile/T9178.stderr
utils/mkUserGuidePart/Options/Warnings.hs