From 82b7acd34706dbe7d490d551b1e2fb9b569e8903 Mon Sep 17 00:00:00 2001 From: rochala Date: Mon, 6 May 2024 19:30:57 +0200 Subject: [PATCH] Updates to submodules, remove unnecessary changes, revert Xlint changes --- community-build/community-projects/discipline | 2 +- .../community-projects/discipline-munit | 2 +- .../community-projects/discipline-specs2 | 2 +- community-build/community-projects/fs2 | 2 +- community-build/community-projects/scodec | 2 +- .../community-projects/shapeless-3 | 2 +- community-build/community-projects/verify | 2 +- .../scala/dotty/communitybuild/projects.scala | 16 +++--- .../tools/dotc/config/ScalaSettings.scala | 50 +++++++------------ .../dotty/tools/dotc/config/Settings.scala | 10 ++-- .../dotc/config/ScalaSettingsTests.scala | 4 +- 11 files changed, 43 insertions(+), 51 deletions(-) diff --git a/community-build/community-projects/discipline b/community-build/community-projects/discipline index 9f519c97c998..27016c356287 160000 --- a/community-build/community-projects/discipline +++ b/community-build/community-projects/discipline @@ -1 +1 @@ -Subproject commit 9f519c97c9980671eb1b80ce1dfb5939bd858418 +Subproject commit 27016c3562871c136e88cc13ffa64a02380265df diff --git a/community-build/community-projects/discipline-munit b/community-build/community-projects/discipline-munit index 4e61f1861956..975ae3efaddd 160000 --- a/community-build/community-projects/discipline-munit +++ b/community-build/community-projects/discipline-munit @@ -1 +1 @@ -Subproject commit 4e61f186195660529e7a6f7461b939477735e3f4 +Subproject commit 975ae3efadddaa558435c4c8326628618048fdad diff --git a/community-build/community-projects/discipline-specs2 b/community-build/community-projects/discipline-specs2 index e689c3e809a8..eb9427335a30 160000 --- a/community-build/community-projects/discipline-specs2 +++ b/community-build/community-projects/discipline-specs2 @@ -1 +1 @@ -Subproject commit e689c3e809a89a03cdbbb3a1771e33148715f6c7 +Subproject commit eb9427335a309d6dd1e82632298529ca6a0920fa diff --git a/community-build/community-projects/fs2 b/community-build/community-projects/fs2 index 6d7c6d6924cb..e91c54621b76 160000 --- a/community-build/community-projects/fs2 +++ b/community-build/community-projects/fs2 @@ -1 +1 @@ -Subproject commit 6d7c6d6924cb055028458ac8236622190acf66d1 +Subproject commit e91c54621b762a58c942b6576c42dcd94ba0fc0a diff --git a/community-build/community-projects/scodec b/community-build/community-projects/scodec index b74f2085f071..9b0423b90de9 160000 --- a/community-build/community-projects/scodec +++ b/community-build/community-projects/scodec @@ -1 +1 @@ -Subproject commit b74f2085f07165d84b32c39eb214c9cc838711cc +Subproject commit 9b0423b90de95fc968fafe4543e6b16ef9f81d08 diff --git a/community-build/community-projects/shapeless-3 b/community-build/community-projects/shapeless-3 index 24e86dd290eb..90f0c977b536 160000 --- a/community-build/community-projects/shapeless-3 +++ b/community-build/community-projects/shapeless-3 @@ -1 +1 @@ -Subproject commit 24e86dd290eba9b27599936a7f338fac975f833d +Subproject commit 90f0c977b536c06305496600b8b2014c9e8e3d86 diff --git a/community-build/community-projects/verify b/community-build/community-projects/verify index 81c1ec3e0d75..f82bb3f52623 160000 --- a/community-build/community-projects/verify +++ b/community-build/community-projects/verify @@ -1 +1 @@ -Subproject commit 81c1ec3e0d754b221dadb97d81d126338a897271 +Subproject commit f82bb3f52623e44f02b4b43f8bdf27f4f0a7d3d4 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index bff06090ce21..ca51db338c84 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -362,7 +362,7 @@ object projects: project = "shapeless-3", sbtTestCommand = "testJVM; testJS", sbtDocCommand = forceDoc("typeable", "deriving"), - scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), // due to -Xfatal-warnings + scalacOptions = "-source" :: "3.3" :: SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), // due to -Xfatal-warnings ) lazy val xmlInterpolator = SbtCommunityProject( @@ -429,7 +429,7 @@ object projects: sbtTestCommand = "unitTests/test", // Adds package sbtDocCommand = "coreJVM/doc", - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), dependencies = List(munit, scodecBits), ) @@ -503,14 +503,14 @@ object projects: project = "verify", sbtTestCommand = "verifyJVM/test", sbtDocCommand = "verifyJVM/doc", - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Xcheck-macros") // TODO enable -Xcheck-macros + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros") // TODO enable -Xcheck-macros ) lazy val discipline = SbtCommunityProject( project = "discipline", sbtTestCommand = "coreJVM/test;coreJS/test", sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal", - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), dependencies = List(scalacheck) ) @@ -540,7 +540,7 @@ object projects: sbtTestCommand = "set Global/scalaJSStage := FastOptStage;rootJVM/test;rootJS/test", sbtPublishCommand = "rootJVM/publishLocal;rootJS/publishLocal", dependencies = List(discipline, disciplineMunit, scalacheck, simulacrumScalafixAnnotations), - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init") // disable -Ysafe-init or -Wsafe-init, due to -Xfatal-warning + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init") // disable -Ysafe-init or -Wsafe-init, due to -Xfatal-warning ) lazy val catsMtl = SbtCommunityProject( @@ -655,7 +655,7 @@ object projects: """set actorTests/Compile/scalacOptions -= "-Xfatal-warnings"""", "akka-actor-tests/Test/compile", ).mkString("; "), - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), dependencies = List(scalatest, scalatestplusJunit, scalatestplusScalacheck) ) @@ -706,7 +706,7 @@ object projects: project = "fs2", sbtTestCommand = "coreJVM/test; coreJS/test", // io/test requires JDK9+ sbtPublishCommand = "coreJVM/publishLocal; coreJS/publishLocal", - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), dependencies = List(cats, catsEffect3, munitCatsEffect, scalacheckEffect, scodecBits) ) @@ -743,7 +743,7 @@ object projects: project = "http4s", sbtTestCommand = """set ThisBuild / tlFatalWarnings := false; rootJVM/test""", sbtPublishCommand = "publishLocal", - scalacOptions = SbtCommunityProject.scalacOptions.filter(flag => flag != "-Ysafe-init" && flag != "-Wsafe-init"), + scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Wsafe-init"), dependencies = List(cats, catsEffect3, fs2, disciplineMunit, scalacheckEffect) ) diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 858c844a6855..5dc7ba821fa6 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -359,20 +359,8 @@ private sealed trait XSettings: val XmacroSettings: Setting[List[String]] = MultiStringSetting(AdvancedSetting, "Xmacro-settings", "setting1,setting2,..settingN", "List of settings which exposed to the macros") - @deprecated(message = "Superseded by -Wshadow, Scheduled for removal in 3.6.0", since = "3.5.0") - val Xlint: Setting[List[ChoiceWithHelp[String]]] = MultiChoiceHelpSetting( - AdvancedSetting, - name = "Xlint", - helpArg = "advanced warning", - descr = "Enable or disable specific `lint` warnings", - choices = List( - ChoiceWithHelp("all", ""), - ChoiceWithHelp("private-shadow", "Warn if a private field or class parameter shadows a superclass field"), - ChoiceWithHelp("type-parameter-shadow", "Warn when a type parameter shadows a type already in the scope"), - ), - default = Nil, - deprecation = Deprecation.renamed("-Wshadow"), - ) + @deprecated(message = "Superseded by -Wshadow, Scheduled for removal", since = "3.5.0") + val Xlint: Setting[_] = BooleanSetting(AdvancedSetting, "Xlint", "Enable or disable specific warnings", deprecation = Some(Deprecation("Use -Wshadow to enable shadowing lints. Scheduled for removal."))) end XSettings @@ -466,41 +454,41 @@ private sealed trait YSettings: val YinstrumentDefs: Setting[Boolean] = BooleanSetting(ForkSetting, "Yinstrument-defs", "Add instrumentation code that counts method calls; needs -Yinstrument to be set, too.") // Deprecated: lifted from -Y to -X - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YtermConflict: Setting[String] = ChoiceSetting(ForkSetting, "Yresolve-term-conflict", "strategy", "Resolve term conflicts", List("package", "object", "error"), "error", deprecation = Deprecation.renamed("-Xresolve-term-conflict")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YnoGenericSig: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-generic-signatures", "Suppress generation of generic signatures for Java.", deprecation = Deprecation.renamed("-Xno-generic-signatures")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val Ydumpclasses: Setting[String] = StringSetting(ForkSetting, "Ydump-classes", "dir", "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders).", default = "", deprecation = Deprecation.renamed("-Xdump-classes")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YjarCompressionLevel: Setting[Int] = IntChoiceSetting(ForkSetting, "Yjar-compression-level", "compression level to use when writing jar files", Deflater.DEFAULT_COMPRESSION to Deflater.BEST_COMPRESSION, Deflater.DEFAULT_COMPRESSION, deprecation = Deprecation.renamed("-Xjar-compression-level")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YkindProjector: Setting[String] = ChoiceSetting(ForkSetting, "Ykind-projector", "[underscores, enable, disable]", "Allow `*` as type lambda placeholder to be compatible with kind projector. When invoked as -Ykind-projector:underscores will repurpose `_` to be a type parameter placeholder, this will disable usage of underscore as a wildcard.", List("disable", "", "underscores"), "disable", legacyArgs = true, deprecation = Deprecation.renamed("-Xkind-projector")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YdropComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Ydrop-docs", "Drop documentation when scanning source files.", aliases = List("-Ydrop-comments"), deprecation = Deprecation.renamed("-Xdrop-docs")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YcookComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Ycook-docs", "Cook the documentation (type check `@usecase`, etc.)", aliases = List("-Ycook-comments"), deprecation = Deprecation.renamed("-Xcook-docs")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YreadComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Yread-docs", "Read documentation from tasty.", deprecation = Deprecation.renamed("-Xread-docs")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.", deprecation = Deprecation.renamed("-Xno-decode-stacktraces")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.", deprecation = Deprecation.renamed("-Xno-enrich-error-messages")) - @deprecated(message = "Lifted to -X, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0") val YdebugMacros: Setting[Boolean] = BooleanSetting(ForkSetting, "Ydebug-macros", "Show debug info when quote pattern match fails", deprecation = Deprecation.renamed("-Xdebug-macros")) - // @deprecated(message = "Lifted to -X, Scheduled for removal in 3.8.0", since = "3.7.0") + // @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.7.0") // val YjavaTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Yjava-tasty", "Pickler phase should compute TASTy for .java defined symbols for use by build tools", aliases = List("-Ypickle-java"), preferPrevious = true, deprecation = Deprecation.lifted("-Xjava-tasty")) - // @deprecated(message = "Lifted to -X, Scheduled for removal in 3.8.0", since = "3.7.0") + // @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.7.0") // val YearlyTastyOutput: Setting[AbstractFile] = OutputSetting(ForkSetting, "Yearly-tasty-output", "directory|jar", "Destination to write generated .tasty files to for use in pipelined compilation.", NoAbstractFile, aliases = List("-Ypickle-write"), preferPrevious = true, deprecation = Deprecation.lifted("-Xearly-tasty-output")) - // @deprecated(message = "Lifted to -X, Scheduled for removal in 3.8.0", since = "3.7.0") + // @deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.7.0") // val YallowOutlineFromTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Yallow-outline-from-tasty", "Allow outline TASTy to be loaded with the -from-tasty option.", deprecation = Deprecation.lifted("-Xallow-outline-from-tasty")) // Deprecated: lifted from -Y to -W - @deprecated(message = "Lifted to -W, Scheduled for removal in 3.6.0", since = "3.5.0") + @deprecated(message = "Lifted to -W, Scheduled for removal.", since = "3.5.0") val YcheckInit: Setting[Boolean] = BooleanSetting(ForkSetting, "Ysafe-init", "Ensure safe initialization of objects.", deprecation = Deprecation.renamed("-Wsafe-init")) // Deprecated: Scheduled for removal - @deprecated(message = "Scheduled for removal in 3.6.0", since = "3.5.0") - val YoutputOnlyTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Youtput-only-tasty", "Used to only generate the TASTy file without the classfiles", deprecation = Deprecation.removed("3.6.0")) + @deprecated(message = "Scheduled for removal.", since = "3.5.0") + val YoutputOnlyTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Youtput-only-tasty", "Used to only generate the TASTy file without the classfiles", deprecation = Deprecation.removed()) end YSettings diff --git a/compiler/src/dotty/tools/dotc/config/Settings.scala b/compiler/src/dotty/tools/dotc/config/Settings.scala index a3b7c50d7d1f..786268f841a8 100644 --- a/compiler/src/dotty/tools/dotc/config/Settings.scala +++ b/compiler/src/dotty/tools/dotc/config/Settings.scala @@ -134,7 +134,9 @@ object Settings: if argStringValue.isEmpty then state.deprecated(deprecatedMsg, List(replacedBy)) else state.deprecated(deprecatedMsg, List(s"$replacedBy:$argStringValue")) - case Some(Deprecation(msg, _)) => state.deprecated(msg) + case Some(Deprecation(msg, _)) => + state.deprecated(s"Option $name is deprecated: $msg") + case None => val value = getValue var dangers = warnings @@ -263,14 +265,16 @@ object Settings: * @param msg deprecation message that will be displayed in following format: s"Option $name is deprecated: $msg" * @param replacedBy option that is substituting current option */ - case class Deprecation private( + case class Deprecation( msg: String, replacedBy: Option[String] = None, ) object Deprecation: def renamed(replacement: String) = Some(Deprecation(s"Use $replacement instead.", Some(replacement))) - def removed(removedVersion: String) = Some(Deprecation(s"Scheduled for removal in s$removedVersion", None)) + def removed(removedVersion: Option[String] = None) = + val msg = removedVersion.map(" in " + _).getOrElse(".") + Some(Deprecation(s"Scheduled for removal$msg", None)) object Setting: extension [T](setting: Setting[T]) diff --git a/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala b/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala index 9ebde841c50b..28dd5e307bc5 100644 --- a/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala +++ b/compiler/test/dotty/tools/dotc/config/ScalaSettingsTests.scala @@ -112,7 +112,7 @@ class ScalaSettingsTests: // createTestCase(settings.YearlyTastyOutput , settings.XearlyTastyOutput, ":./"), // createTestCase(settings.YallowOutlineFromTasty, settings.XallowOutlineFromTasty), createTestCase(settings.YcheckInit , settings.WcheckInit), - createTestCase(settings.Xlint , settings.Wshadow, ":all"), + // createTestCase(settings.Xlint , settings.Wshadow, ":all"), // this setting is not going to be mapped to replacement. Read more in the commit message ).map: (deprecatedArgument, newSetting) => val args = List(deprecatedArgument) val argSummary = ArgsSummary(settings.defaultState, args, errors = Nil, warnings = Nil) @@ -171,7 +171,7 @@ class ScalaSettingsTests: // createTestCase(settings.YearlyTastyOutput , settings.XearlyTastyOutput, ":./"), // createTestCase(settings.YallowOutlineFromTasty, settings.XallowOutlineFromTasty), createTestCase(settings.YcheckInit , settings.WcheckInit), - createTestCase(settings.Xlint , settings.Wshadow, ":all"), + // createTestCase(settings.Xlint , settings.Wshadow, ":all"), // this setting is not going to be mapped to replacement. Read more in the commit message ).flatten.map: (deprecatedArgument, newSetting) => val args = List(deprecatedArgument) val argSummary = ArgsSummary(settings.defaultState, args, errors = Nil, warnings = Nil)