renamer: fix module-level deprecation message
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 25 Jul 2015 08:37:44 +0000 (09:37 +0100)
committerSergei Trofimovich <siarheit@google.com>
Sat, 25 Jul 2015 08:39:03 +0000 (09:39 +0100)
commitb04bed0a391335e70b3c3bdbdccbaa0781697cce
tree23aa621d8bf8fc048504b6eb2854a79a41c275d4
parent09d05050346c1be7bac20ba3f40861e05217368b
renamer: fix module-level deprecation message

Noticed today that deprecation warnings are
slightly broken in -HEAD:

  mtl-2.2.1/Control/Monad/Error/Class.hs:46:1: warning:
    Module â€˜Control.Monad.Trans.Error’ is deprecated:
      ([", U, s, e,  , C, o, n, t, r, o, l, ., M, o, n, a, d, ., T, r, a,
        n, s, ., E, x, c, e, p, t,  , i, n, s, t, e, a, d, "],
       Use Control.Monad.Trans.Except instead)

Commit e6191d1cc37e98785af8b309100ea840084fa3ba
slightly changed WarningTxt declaration:

-data WarningTxt = WarningTxt (Located SourceText) [Located FastString]
-                | DeprecatedTxt (Located SourceText) [Located FastString]
+data WarningTxt = WarningTxt (Located SourceText)
+                             [Located (SourceText,FastString)]
+                | DeprecatedTxt (Located SourceText)
+                                [Located (SourceText,FastString)]

But 'moduleWarn' function was not updated to do the stripping.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Reviewers: austin, bgamari, hvr, goldfire, rwbarton, alanz

Reviewed By: rwbarton, alanz

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1096

GHC Trac Issues: #10313
compiler/rename/RnNames.hs
testsuite/tests/warnings/should_compile/DeprM.hs [new file with mode: 0644]
testsuite/tests/warnings/should_compile/DeprU.hs [new file with mode: 0644]
testsuite/tests/warnings/should_compile/DeprU.stderr [new file with mode: 0644]
testsuite/tests/warnings/should_compile/all.T