diff --git a/src/compiler/scala/tools/nsc/settings/Warnings.scala b/src/compiler/scala/tools/nsc/settings/Warnings.scala index 8c13e0542c36..2f5cbdd52dd6 100644 --- a/src/compiler/scala/tools/nsc/settings/Warnings.scala +++ b/src/compiler/scala/tools/nsc/settings/Warnings.scala @@ -90,6 +90,8 @@ trait Warnings { |Full list of message categories: |${WarningCategory.all.keys.groupBy(_.split('-').head).toList.sortBy(_._1).map(_._2.toList.sorted.mkString(", ")).mkString(" - ", "\n - ", "")} | + |To suppress warnings locally, use the `scala.annotation.silent` annotation. + | |Note: on the command-line you might need to quote configurations containing `*` or `&` |to prevent the shell from expanding patterns.""".stripMargin), prepend = true) diff --git a/src/library/scala/annotation/silent.scala b/src/library/scala/annotation/silent.scala index 23bc483f3729..324c3da63b01 100644 --- a/src/library/scala/annotation/silent.scala +++ b/src/library/scala/annotation/silent.scala @@ -28,5 +28,7 @@ package scala.annotation * @silent("msg=pure expression does nothing") * def f = { 1; deprecated() } // show deprecation warning * }}} + * + * To ensure that a `@silent` annotation actually suppresses a warning, enable `-Xlint:silent`. */ class silent(value: String = "") extends ConstantAnnotation