summaryrefslogtreecommitdiff
path: root/testsuite/tests/safeHaskell
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2016-02-27 18:48:04 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2016-02-27 18:48:04 +0100
commitb6c61e372a1a783b32f1bbd1ceb446e89478a138 (patch)
tree3af052ff05beba0e07d185232ca22aab28940878 /testsuite/tests/safeHaskell
parent82f200b74ac1ea8c5593e2909c0033eb251eeaf2 (diff)
downloadhaskell-b6c61e372a1a783b32f1bbd1ceb446e89478a138.tar.gz
Print which flag controls emitted SafeHaskell warnings
This is extends bb5afd3c274011c5ea302210b4c290ec1f83209c to cover SafeHaskell warnings. This implements yet another part of #10752
Diffstat (limited to 'testsuite/tests/safeHaskell')
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags22.stderr4
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags23.stderr6
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags25.stderr2
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags26.stderr4
-rw-r--r--testsuite/tests/safeHaskell/overlapping/SH_Overlap11.stderr23
-rw-r--r--testsuite/tests/safeHaskell/overlapping/SH_Overlap7.stderr23
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/SafeInfered05.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/SafeWarn01.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/TrustworthySafe02.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/TrustworthySafe03.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr6
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeInfered12.stderr4
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn01.stderr4
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn02.stderr2
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn03.stderr4
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn04.stderr4
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr8
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr4
-rw-r--r--testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr4
19 files changed, 56 insertions, 54 deletions
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags22.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags22.stderr
index 5e1801c0cb..42d10b32c8 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags22.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags22.stderr
@@ -1,7 +1,7 @@
-SafeFlags22.hs:1:16: Warning:
+SafeFlags22.hs:1:16: warning: [-Wunsafe]
‘SafeFlags22’ has been inferred as unsafe!
Reason:
- SafeFlags22.hs:7:1:
+ SafeFlags22.hs:7:1: error:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags23.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags23.stderr
index b2a57091ce..f4e46c2aa8 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags23.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags23.stderr
@@ -1,10 +1,10 @@
-SafeFlags23.hs:1:16: Warning:
+SafeFlags23.hs:1:16: warning: [-Wunsafe]
‘SafeFlags22’ has been inferred as unsafe!
Reason:
- SafeFlags23.hs:7:1:
+ SafeFlags23.hs:7:1: error:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
-<no location info>:
+<no location info>: error:
Failing due to -Werror.
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags25.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags25.stderr
index 434ea2b9ca..bf82025b4c 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags25.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags25.stderr
@@ -1,3 +1,3 @@
-SafeFlags25.hs:1:16: Warning:
+SafeFlags25.hs:1:16: warning: [-Wsafe]
‘SafeFlags25’ has been inferred as safe!
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags26.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags26.stderr
index 47dd8828d4..bc27ac2a4f 100644
--- a/testsuite/tests/safeHaskell/flags/SafeFlags26.stderr
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags26.stderr
@@ -1,6 +1,6 @@
-SafeFlags26.hs:1:16: Warning:
+SafeFlags26.hs:1:16: warning: [-Wsafe]
‘SafeFlags26’ has been inferred as safe!
-<no location info>:
+<no location info>: error:
Failing due to -Werror.
diff --git a/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.stderr b/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.stderr
index 76d7779631..aca02ef4a9 100644
--- a/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.stderr
+++ b/testsuite/tests/safeHaskell/overlapping/SH_Overlap11.stderr
@@ -2,17 +2,18 @@
[2 of 3] Compiling SH_Overlap11_A ( SH_Overlap11_A.hs, SH_Overlap11_A.o )
[3 of 3] Compiling SH_Overlap11 ( SH_Overlap11.hs, SH_Overlap11.o )
-SH_Overlap11.hs:1:16: warning:
+SH_Overlap11.hs:1:16: warning: [-Wunsafe]
‘SH_Overlap11’ has been inferred as unsafe!
Reason:
SH_Overlap11.hs:17:8: warning:
- Unsafe overlapping instances for C [Int] arising from a use of ‘f’
- The matching instance is:
- instance [overlap ok] [safe] C [Int]
- -- Defined at SH_Overlap11_A.hs:11:3
- It is compiled in a Safe module and as such can only
- overlap instances from the same module, however it
- overlaps the following instances from different modules:
- instance C [a] -- Defined at SH_Overlap11.hs:13:3
- In the expression: f ([1, 2, 3, 4] :: [Int])
- In an equation for ‘test’: test = f ([1, 2, 3, 4] :: [Int])
+ • Unsafe overlapping instances for C [Int]
+ arising from a use of ‘f’
+ The matching instance is:
+ instance [overlap ok] [safe] C [Int]
+ -- Defined at SH_Overlap11_A.hs:11:3
+ It is compiled in a Safe module and as such can only
+ overlap instances from the same module, however it
+ overlaps the following instances from different modules:
+ instance C [a] -- Defined at SH_Overlap11.hs:13:3
+ • In the expression: f ([1, 2, 3, 4] :: [Int])
+ In an equation for ‘test’: test = f ([1, 2, 3, 4] :: [Int])
diff --git a/testsuite/tests/safeHaskell/overlapping/SH_Overlap7.stderr b/testsuite/tests/safeHaskell/overlapping/SH_Overlap7.stderr
index 088d0f06b3..8010407cc7 100644
--- a/testsuite/tests/safeHaskell/overlapping/SH_Overlap7.stderr
+++ b/testsuite/tests/safeHaskell/overlapping/SH_Overlap7.stderr
@@ -2,20 +2,21 @@
[2 of 3] Compiling SH_Overlap7_A ( SH_Overlap7_A.hs, SH_Overlap7_A.o )
[3 of 3] Compiling SH_Overlap7 ( SH_Overlap7.hs, SH_Overlap7.o )
-SH_Overlap7.hs:1:16: warning:
+SH_Overlap7.hs:1:16: warning: [-Wunsafe]
‘SH_Overlap7’ has been inferred as unsafe!
Reason:
SH_Overlap7.hs:14:8: warning:
- Unsafe overlapping instances for C [Int] arising from a use of ‘f’
- The matching instance is:
- instance [overlap ok] [safe] C [Int]
- -- Defined at SH_Overlap7_A.hs:12:3
- It is compiled in a Safe module and as such can only
- overlap instances from the same module, however it
- overlaps the following instances from different modules:
- instance C [a] -- Defined at SH_Overlap7.hs:10:10
- In the expression: f ([1, 2, 3, 4] :: [Int])
- In an equation for ‘test’: test = f ([1, 2, 3, 4] :: [Int])
+ • Unsafe overlapping instances for C [Int]
+ arising from a use of ‘f’
+ The matching instance is:
+ instance [overlap ok] [safe] C [Int]
+ -- Defined at SH_Overlap7_A.hs:12:3
+ It is compiled in a Safe module and as such can only
+ overlap instances from the same module, however it
+ overlaps the following instances from different modules:
+ instance C [a] -- Defined at SH_Overlap7.hs:10:10
+ • In the expression: f ([1, 2, 3, 4] :: [Int])
+ In an equation for ‘test’: test = f ([1, 2, 3, 4] :: [Int])
<no location info>: error:
Failing due to -Werror.
diff --git a/testsuite/tests/safeHaskell/safeInfered/SafeInfered05.stderr b/testsuite/tests/safeHaskell/safeInfered/SafeInfered05.stderr
index 0690054ae7..5d194064b8 100644
--- a/testsuite/tests/safeHaskell/safeInfered/SafeInfered05.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/SafeInfered05.stderr
@@ -3,6 +3,6 @@ SafeInfered05.hs:2:14: warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
[1 of 2] Compiling SafeInfered05_A ( SafeInfered05_A.hs, SafeInfered05_A.o )
-SafeInfered05_A.hs:2:16: warning:
+SafeInfered05_A.hs:2:16: warning: [-Wsafe]
‘SafeInfered05_A’ has been inferred as safe!
[2 of 2] Compiling SafeInfered05 ( SafeInfered05.hs, SafeInfered05.o )
diff --git a/testsuite/tests/safeHaskell/safeInfered/SafeWarn01.stderr b/testsuite/tests/safeHaskell/safeInfered/SafeWarn01.stderr
index e9849d9eef..5e824de641 100644
--- a/testsuite/tests/safeHaskell/safeInfered/SafeWarn01.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/SafeWarn01.stderr
@@ -1,3 +1,3 @@
-SafeWarn01.hs:2:16: Warning:
+SafeWarn01.hs:2:16: warning: [-Wsafe]
‘SafeWarn01’ has been inferred as safe!
diff --git a/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe02.stderr b/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe02.stderr
index 68bf4e998e..7d42cb016f 100644
--- a/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe02.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe02.stderr
@@ -1,3 +1,3 @@
-TrustworthySafe02.hs:1:14: Warning:
+TrustworthySafe02.hs:1:14: warning: [-Wtrustworthy-safe (in -Wall)]
‘TrustworthySafe02’ is marked as Trustworthy but has been inferred as safe!
diff --git a/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe03.stderr b/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe03.stderr
index 9505d06031..9938109dcb 100644
--- a/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe03.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/TrustworthySafe03.stderr
@@ -1,3 +1,3 @@
-TrustworthySafe03.hs:1:14: Warning:
+TrustworthySafe03.hs:1:14: warning: [-Wtrustworthy-safe (in -Wall)]
‘TrustworthySafe03’ is marked as Trustworthy but has been inferred as safe!
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr
index d1cfe99158..18a6a459c7 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered11.stderr
@@ -1,13 +1,13 @@
[1 of 2] Compiling UnsafeInfered11_A ( UnsafeInfered11_A.hs, UnsafeInfered11_A.o )
-UnsafeInfered11_A.hs:1:16: Warning:
+UnsafeInfered11_A.hs:1:16: warning: [-Wunsafe]
‘UnsafeInfered11_A’ has been inferred as unsafe!
Reason:
- UnsafeInfered11_A.hs:17:11: Warning:
+ UnsafeInfered11_A.hs:17:11: warning:
Rule "lookupx/T" ignored
User defined rules are disabled under Safe Haskell
[2 of 2] Compiling UnsafeInfered11 ( UnsafeInfered11.hs, UnsafeInfered11.o )
-UnsafeInfered11.hs:5:1:
+UnsafeInfered11.hs:5:1: error:
UnsafeInfered11_A: Can't be safely imported!
The module itself isn't safe.
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered12.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered12.stderr
index 470e1b71e6..74cf60dc54 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered12.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeInfered12.stderr
@@ -1,9 +1,9 @@
-UnsafeInfered12.hs:2:16: Warning:
+UnsafeInfered12.hs:2:16: warning: [-Wunsafe]
‘UnsafeInfered12’ has been inferred as unsafe!
Reason:
UnsafeInfered12.hs:1:14:
-XTemplateHaskell is not allowed in Safe Haskell
-<no location info>:
+<no location info>: error:
Failing due to -Werror.
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn01.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn01.stderr
index 1ef043a9fd..6d2afb2193 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn01.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn01.stderr
@@ -1,7 +1,7 @@
-UnsafeWarn01.hs:2:16: Warning:
+UnsafeWarn01.hs:2:16: warning: [-Wunsafe]
‘UnsafeWarn01’ has been inferred as unsafe!
Reason:
- UnsafeWarn01.hs:7:1:
+ UnsafeWarn01.hs:7:1: error:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn02.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn02.stderr
index 7421ad0333..2ee83ac140 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn02.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn02.stderr
@@ -1,5 +1,5 @@
-UnsafeWarn02.hs:2:16: Warning:
+UnsafeWarn02.hs:2:16: warning: [-Wunsafe]
‘UnsafeWarn02’ has been inferred as unsafe!
Reason:
UnsafeWarn02.hs:4:14:
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn03.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn03.stderr
index a3d44ba375..6ddea45af1 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn03.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn03.stderr
@@ -1,7 +1,7 @@
-UnsafeWarn03.hs:3:16: Warning:
+UnsafeWarn03.hs:3:16: warning: [-Wunsafe]
‘UnsafeWarn03’ has been inferred as unsafe!
Reason:
- UnsafeWarn03.hs:8:1:
+ UnsafeWarn03.hs:8:1: error:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn04.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn04.stderr
index 66deff4edc..c91f421344 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn04.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn04.stderr
@@ -1,7 +1,7 @@
-UnsafeWarn04.hs:3:16: Warning:
+UnsafeWarn04.hs:3:16: warning: [-Wunsafe]
‘UnsafeWarn04’ has been inferred as unsafe!
Reason:
- UnsafeWarn04.hs:8:1:
+ UnsafeWarn04.hs:8:1: error:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr
index 229ce3d56f..dfd4193b7a 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn05.stderr
@@ -1,14 +1,14 @@
-UnsafeWarn05.hs:4:16: Warning:
+UnsafeWarn05.hs:4:16: warning: [-Wunsafe]
‘UnsafeWarn05’ has been inferred as unsafe!
Reason:
- UnsafeWarn05.hs:10:1:
+ UnsafeWarn05.hs:10:1: error:
System.IO.Unsafe: Can't be safely imported!
The module itself isn't safe.
-UnsafeWarn05.hs:4:16: Warning:
+UnsafeWarn05.hs:4:16: warning: [-Wunsafe]
‘UnsafeWarn05’ has been inferred as unsafe!
Reason:
- UnsafeWarn05.hs:15:11: Warning:
+ UnsafeWarn05.hs:15:11: warning:
Rule "g" ignored
User defined rules are disabled under Safe Haskell
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr
index 8fde73ee0b..323bb19a39 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn06.stderr
@@ -1,7 +1,7 @@
-UnsafeWarn06.hs:3:16: Warning:
+UnsafeWarn06.hs:3:16: warning: [-Wunsafe]
‘UnsafeWarn06’ has been inferred as unsafe!
Reason:
- UnsafeWarn06.hs:8:11: Warning:
+ UnsafeWarn06.hs:8:11: warning:
Rule "f" ignored
User defined rules are disabled under Safe Haskell
diff --git a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr
index c5c5e632d7..11116b6460 100644
--- a/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr
+++ b/testsuite/tests/safeHaskell/safeInfered/UnsafeWarn07.stderr
@@ -1,7 +1,7 @@
-UnsafeWarn07.hs:4:16: Warning:
+UnsafeWarn07.hs:4:16: warning: [-Wunsafe]
‘UnsafeWarn07’ has been inferred as unsafe!
Reason:
- UnsafeWarn07.hs:9:11: Warning:
+ UnsafeWarn07.hs:9:11: warning:
Rule "f" ignored
User defined rules are disabled under Safe Haskell