summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-04-11 13:56:55 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-13 06:24:52 -0400
commita42dbc55ad1aff242c0b6b2b22188a25d588c8bf (patch)
tree13c93d1960c5ce1e36dd4052685207bd9fcbccc0
parentb06f4f470b6bbe296cc828f8698e9d55cca39d73 (diff)
downloadhaskell-a42dbc55ad1aff242c0b6b2b22188a25d588c8bf.tar.gz
Refine warning about defining rules in SAFE modules
This change makes it clear that it's the definition rather than any usage which is a problem, and that rules defined in other modules will still be used to do rewrites. Fixes #20923
-rw-r--r--compiler/GHC/Driver/Errors/Ppr.hs2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr3
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeLanguage/SafeLang03.stderr2
6 files changed, 7 insertions, 6 deletions
diff --git a/compiler/GHC/Driver/Errors/Ppr.hs b/compiler/GHC/Driver/Errors/Ppr.hs
index 76a0ed15d3..8fe416196b 100644
--- a/compiler/GHC/Driver/Errors/Ppr.hs
+++ b/compiler/GHC/Driver/Errors/Ppr.hs
@@ -148,7 +148,7 @@ instance Diagnostic DriverMessage where
DriverUserDefinedRuleIgnored (HsRule { rd_name = n })
-> mkSimpleDecorated $
text "Rule \"" <> ftext (snd $ unLoc n) <> text "\" ignored" $+$
- text "User defined rules are disabled under Safe Haskell"
+ text "Defining user rules is disabled under Safe Haskell"
DriverMixedSafetyImport modName
-> mkSimpleDecorated $
text "Module" <+> ppr modName <+> text ("is imported both as a safe and unsafe import!")
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr
index 8f08181038..0122d91398 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr
@@ -1,9 +1,10 @@
+
UnsafeInfered11_A.hs:2:17: warning: [-Wunsafe]
‘UnsafeInfered11_A’ has been inferred as unsafe!
Reason:
UnsafeInfered11_A.hs:18:11: warning:
Rule "lookupx/T" ignored
- User defined rules are disabled under Safe Haskell
+ Defining user rules is disabled under Safe Haskell
UnsafeInfered11.hs:6:1: error:
UnsafeInfered11_A: Can't be safely imported!
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr
index 471443ea12..c43acb86d8 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr
@@ -11,4 +11,4 @@ UnsafeWarn05.hs:5:17: warning: [-Wunsafe]
Reason:
UnsafeWarn05.hs:16:11: warning:
Rule "g" ignored
- User defined rules are disabled under Safe Haskell
+ Defining user rules is disabled under Safe Haskell
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr
index b494f02eec..8f7641d2b0 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr
@@ -4,4 +4,4 @@ UnsafeWarn06.hs:4:17: warning: [-Wunsafe]
Reason:
UnsafeWarn06.hs:9:11: warning:
Rule "f" ignored
- User defined rules are disabled under Safe Haskell
+ Defining user rules is disabled under Safe Haskell
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr
index 0b3370cb59..1439e24cc0 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr
@@ -4,4 +4,4 @@ UnsafeWarn07.hs:5:17: warning: [-Wunsafe]
Reason:
UnsafeWarn07.hs:10:11: warning:
Rule "f" ignored
- User defined rules are disabled under Safe Haskell
+ Defining user rules is disabled under Safe Haskell
diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang03.stderr b/testsuite/tests/safeHaskell/safeLanguage/SafeLang03.stderr
index 20d4d174b2..02f0cc5ebb 100644
--- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang03.stderr
+++ b/testsuite/tests/safeHaskell/safeLanguage/SafeLang03.stderr
@@ -1,4 +1,4 @@
SafeLang03.hs:8:11: warning:
Rule "f" ignored
- User defined rules are disabled under Safe Haskell
+ Defining user rules is disabled under Safe Haskell