File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/profile
library/src/scala/runtime Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11package dotty .tools .dotc .profile
22
3+ import scala .annotation .*
34import scala .language .unsafeNulls
45
56import 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()
Original file line number Diff line number Diff line change 11package scala .runtime
22
3+ import scala .annotation .*
4+
35/**
46 * Helper methods used in thread-safe lazy vals.
57 */
68object LazyVals {
9+ @ nowarn
710 private [this ] val unsafe : sun.misc.Unsafe =
811 classOf [sun.misc.Unsafe ].getDeclaredFields.nn.find { field =>
912 field.nn.getType == classOf [sun.misc.Unsafe ] && {
@@ -100,13 +103,15 @@ object LazyVals {
100103 }
101104
102105 def getOffset (clz : Class [_], name : String ): Long = {
106+ @ nowarn
103107 val r = unsafe.objectFieldOffset(clz.getDeclaredField(name))
104108 if (debug)
105109 println(s " getOffset( $clz, $name) = $r" )
106110 r
107111 }
108112
109113 def getOffsetStatic (field : java.lang.reflect.Field ) =
114+ @ nowarn
110115 val r = unsafe.objectFieldOffset(field)
111116 if (debug)
112117 println(s " getOffset( ${field.getDeclaringClass}, ${field.getName}) = $r" )
Original file line number Diff line number Diff line change @@ -169,9 +169,10 @@ object Build {
169169 " -feature" ,
170170 " -deprecation" ,
171171 " -unchecked" ,
172- " -Xfatal-warnings" ,
172+ // "-Wconf:cat=deprecation&msg=Unsafe:s", // example usage
173+ " -Xfatal-warnings" , // -Werror in modern usage
173174 " -encoding" , " UTF8" ,
174- " -language:implicitConversions"
175+ " -language:implicitConversions" ,
175176 ),
176177
177178 (Compile / compile / javacOptions) ++= Seq (" -Xlint:unchecked" , " -Xlint:deprecation" ),
You can’t perform that action at this time.
0 commit comments