Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
7ed67597
Commit
7ed67597
authored
Apr 03, 2012
by
dterei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update safe haskell error/warn formatting
parent
c690214d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
compiler/main/HscMain.hs
compiler/main/HscMain.hs
+11
-15
No files found.
compiler/main/HscMain.hs
View file @
7ed67597
...
@@ -1031,8 +1031,8 @@ hscCheckSafe' dflags m l = do
...
@@ -1031,8 +1031,8 @@ hscCheckSafe' dflags m l = do
case
iface
of
case
iface
of
-- can't load iface to check trust!
-- can't load iface to check trust!
Nothing
->
throwErrors
$
unitBag
$
mkPlainErrMsg
l
Nothing
->
throwErrors
$
unitBag
$
mkPlainErrMsg
l
$
text
"Can't load the interface file for"
<+>
ppr
m
<>
$
text
"Can't load the interface file for"
<+>
ppr
m
text
", to check that it can be safely imported"
<>
text
", to check that it can be safely imported"
-- got iface, check trust
-- got iface, check trust
Just
iface'
->
do
Just
iface'
->
do
...
@@ -1053,14 +1053,14 @@ hscCheckSafe' dflags m l = do
...
@@ -1053,14 +1053,14 @@ hscCheckSafe' dflags m l = do
where
where
pkgTrustErr
=
mkSrcErr
$
unitBag
$
mkPlainErrMsg
l
$
pkgTrustErr
=
mkSrcErr
$
unitBag
$
mkPlainErrMsg
l
$
sep
[
ppr
(
moduleName
m
)
<>
text
":"
sep
[
ppr
(
moduleName
m
)
,
text
"
Can't be safely imported!"
<>
text
":
Can't be safely imported!"
,
text
"The package ("
<>
ppr
(
modulePackageId
m
)
,
text
"The package ("
<>
ppr
(
modulePackageId
m
)
<>
text
") the module resides in isn't trusted."
<>
text
") the module resides in isn't trusted."
]
]
modTrustErr
=
unitBag
$
mkPlainErrMsg
l
$
modTrustErr
=
unitBag
$
mkPlainErrMsg
l
$
sep
[
ppr
(
moduleName
m
)
<>
text
":"
sep
[
ppr
(
moduleName
m
)
,
text
"
Can't be safely imported!"
<>
text
":
Can't be safely imported!"
,
text
"The module itself isn't safe."
]
,
text
"The module itself isn't safe."
]
-- | Check the package a module resides in is trusted. Safe compiled
-- | Check the package a module resides in is trusted. Safe compiled
...
@@ -1115,8 +1115,8 @@ checkPkgTrust dflags pkgs =
...
@@ -1115,8 +1115,8 @@ checkPkgTrust dflags pkgs =
=
Nothing
=
Nothing
|
otherwise
|
otherwise
=
Just
$
mkPlainErrMsg
noSrcSpan
=
Just
$
mkPlainErrMsg
noSrcSpan
$
text
"The package ("
<>
ppr
pkg
<>
text
") is required"
$
text
"The package ("
<>
ppr
pkg
<>
text
") is required"
<>
<>
text
" to be trusted but it isn't!"
text
" to be trusted but it isn't!"
-- | Set module to unsafe and wipe trust information.
-- | Set module to unsafe and wipe trust information.
--
--
...
@@ -1139,19 +1139,15 @@ wipeTrust tcg_env whyUnsafe = do
...
@@ -1139,19 +1139,15 @@ wipeTrust tcg_env whyUnsafe = do
pprMod
=
ppr
$
moduleName
$
tcg_mod
tcg_env
pprMod
=
ppr
$
moduleName
$
tcg_mod
tcg_env
whyUnsafe'
df
=
vcat
[
quotes
pprMod
<+>
text
"has been infered as unsafe!"
whyUnsafe'
df
=
vcat
[
quotes
pprMod
<+>
text
"has been infered as unsafe!"
,
text
"Reason:"
,
text
"Reason:"
,
nest
4
$
,
nest
4
$
(
vcat
$
badFlags
df
)
$+$
(
vcat
$
badFlags
df
)
$+$
(
vcat
$
pprErrMsgBagWithLoc
whyUnsafe
)
(
vcat
$
pprErrMsgBagWithLoc
whyUnsafe
)
]
]
badFlags
df
=
concat
$
map
(
badFlag
df
)
unsafeFlags
badFlags
df
=
concat
$
map
(
badFlag
df
)
unsafeFlags
badFlag
df
(
str
,
loc
,
on
,
_
)
badFlag
df
(
str
,
loc
,
on
,
_
)
|
on
df
=
[
mkLocMessage
SevOutput
(
loc
df
)
$
|
on
df
=
[
mkLocMessage
SevOutput
(
loc
df
)
$
text
str
<+>
text
"is not allowed in Safe Haskell"
]
text
str
<+>
text
"is not allowed in Safe Haskell"
]
|
otherwise
=
[]
|
otherwise
=
[]
--------------------------------------------------------------
--------------------------------------------------------------
-- Simplifiers
-- Simplifiers
--------------------------------------------------------------
--------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment