Skip to content

Commit d14e2ef

Browse files
authored
Merge pull request #82088 from bnbarham/missing-doc-files
[Doc] Add missing diagnostic groups
2 parents 6bef9e9 + b3dd0ac commit d14e2ef

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Diagnostic descriptions
2+
3+
Detailed explanations for various compiler diagnostics.
4+
5+
6+
## Overview
7+
8+
Swift diagnostics are classified into errors and warnings. Warnings can only be silenced in an
9+
intentional manner, e.g., adding `_ =` for an unused function result.
10+
11+
Some diagnostics have more detailed explanations available. These include a `[#Name]` inline and
12+
reference to this documentation at the end of the compiler output on the command line, or is
13+
presented specially within your IDE of choice. See below for the full list of these notes.
14+
15+
16+
## Topics
17+
18+
- <doc:actor-isolated-call>
19+
- <doc:conformance-isolation>
20+
- <doc:dynamic-callable-requirements>
21+
- <doc:error-in-future-swift-version>
22+
- <doc:existential-member-access-limitations>
23+
- <doc:isolated-conformances>
24+
- <doc:multiple-inheritance>
25+
- <doc:mutable-global-variable>
26+
- <doc:nominal-types>
27+
- <doc:opaque-type-inference>
28+
- <doc:property-wrapper-requirements>
29+
- <doc:protocol-type-non-conformance>
30+
- <doc:result-builder-methods>
31+
- <doc:sendable-closure-captures>
32+
- <doc:sending-closure-risks-data-race>
33+
- <doc:sendable-metatypes>
34+
- <doc:sending-risks-data-race>
35+
- <doc:string-interpolation-conformance>
36+
- <doc:temporary-pointers>
37+
- <doc:trailing-closure-matching>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Diagnostic groups
2+
3+
Diagnostic groups allow controlling the behavior of warnings in a more precise manner.
4+
5+
6+
## Overview
7+
8+
Diagnostic groups collect some number of diagnostics together under a common group name. This allows
9+
for extra documentation to help explain relevant language concepts, as well as the ability to
10+
control the behavior of warnings in a more precise manner:
11+
- `-Werror <group>` - upgrades warnings in the specified group to errors
12+
- `-Wwarning <group>` - indicates that warnings in the specified group should remain warnings, even
13+
if they were previously upgraded to errors
14+
15+
As a concrete example, to upgrade deprecated declaration warnings to errors:
16+
```sh
17+
-Werror DeprecatedDeclaration
18+
```
19+
20+
Or upgrade all warnings except deprecated declaration to errors:
21+
```sh
22+
-warnings-as-errors -Wwarning DeprecatedDeclaration
23+
```
24+
25+
26+
## Topics
27+
28+
- <doc:clang-declaration-import>
29+
- <doc:deprecated-declaration>
30+
- <doc:preconcurrency-import>
31+
- <doc:strict-language-features>
32+
- <doc:strict-memory-safety>
33+
- <doc:unknown-warning-group>
34+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Upcoming language features
2+
3+
Upcoming language features enable new (but potentially source breaking) functionality that be
4+
enabled by default in an upcoming language mode.
5+
6+
7+
## Overview
8+
9+
Upcoming language features allow the incremental adoption of language features that would otherwise
10+
only be available in a new language mode, without having to fully migrate to that mode. They can be
11+
enabled on the command line with `-enable-upcoming-feature <feature>`.
12+
13+
Some upcoming features have an additional "migration" mode, where the compiler will emit warnings
14+
with fix-its to help migrate to that mode. This can be enabled with `-enable-upcoming-feature
15+
<feature>:migrate`.
16+
17+
18+
## Topics
19+
20+
- <doc:existential-any>
21+
- <doc:member-import-visibility>
22+
- <doc:nonisolated-nonsending-by-default>

0 commit comments

Comments
 (0)