Skip to content

Commit e6220fc

Browse files
committed
Use Wconf to silence Unsafe usage under jdk18
1 parent 5a8a61d commit e6220fc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/profile/Profiler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dotty.tools.dotc.profile
22

3+
import scala.annotation.*
34
import scala.language.unsafeNulls
45

56
import java.io.{FileWriter, PrintWriter}
@@ -123,6 +124,7 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
123124
}
124125
private def readHeapUsage() = RealProfiler.memoryMx.getHeapMemoryUsage.getUsed
125126

127+
@nowarn
126128
private def doGC: Unit = {
127129
System.gc()
128130
System.runFinalization()

project/Build.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ object Build {
169169
"-feature",
170170
"-deprecation",
171171
"-unchecked",
172-
"-Xfatal-warnings",
172+
"-Wconf:cat=deprecation&msg=Unsafe:s",
173+
"-Werror",
173174
"-encoding", "UTF8",
174-
"-language:implicitConversions"
175+
"-language:implicitConversions",
175176
),
176177

177178
(Compile / compile / javacOptions) ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),

0 commit comments

Comments
 (0)