Point at diagnostic group documentation on docs.swift.org

This commit is contained in:
Doug Gregor
2025-04-14 20:08:24 -07:00
parent ccce10d28b
commit 5b5a3e3d07
4 changed files with 8 additions and 8 deletions

View File

@@ -2636,7 +2636,7 @@ static void configureDiagnosticEngine(
std::string docsPath = Options.DiagnosticDocumentationPath;
if (docsPath.empty()) {
// Point at the latest Markdown documentation on GitHub.
docsPath = "https://github.com/swiftlang/swift/tree/main/userdocs/diagnostics";
docsPath = "https://docs.swift.org/compiler/documentation/diagnostics";
}
Diagnostics.setDiagnosticDocumentationPath(docsPath);

View File

@@ -10,7 +10,7 @@ func f() { }
func g() {
f()
// CHECK: [[@LINE-1]]:3: warning: 'f()' is deprecated: please do not use [-W{{.*}}deprecated-declaration.md] [DeprecatedDeclaration]
// CHECK: [[@LINE-1]]:3: warning: 'f()' is deprecated: please do not use [-W{{.*}}deprecated-declaration] [DeprecatedDeclaration]
}
@@ -19,7 +19,7 @@ func beCareful() { }
func test() {
beCareful()
// CHECK: [[@LINE-1]]:3: warning: expression uses unsafe constructs but is not marked with 'unsafe' [-W{{.*}}strict-memory-safety.md] [StrictMemorySafety]
// CHECK: [[@LINE-1]]:3: warning: expression uses unsafe constructs but is not marked with 'unsafe' [-W{{.*}}strict-memory-safety] [StrictMemorySafety]
}
// CHECK: [StrictMemorySafety]: <{{.*}}strict-memory-safety.md>
// CHECK: [StrictMemorySafety]: <{{.*}}strict-memory-safety>

View File

@@ -7,13 +7,13 @@
typealias Fn = () -> ()
extension Fn {}
// CHECK: [[@LINE-1]]:1: error: non-nominal type 'Fn' (aka '() -> ()') cannot be extended [{{.*}}nominal-types.md] [NominalTypes]
// CHECK: [[@LINE-1]]:1: error: non-nominal type 'Fn' (aka '() -> ()') cannot be extended [{{.*}}nominal-types] [NominalTypes]
// Shares the flag record with `Fn`
typealias Dup = () -> ()
extension Dup {}
// CHECK: [[@LINE-1]]:1: error: non-nominal type 'Dup' (aka '() -> ()') cannot be extended [{{.*}}nominal-types.md] [NominalTypes]
// CHECK: [[@LINE-1]]:1: error: non-nominal type 'Dup' (aka '() -> ()') cannot be extended [{{.*}}nominal-types] [NominalTypes]
do {
func noNote(_: Int) {}

View File

@@ -1,5 +1,5 @@
// RUN: %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK-FILE -check-prefix CHECK
// RUN: %target-swift-frontend -typecheck %s -diagnostic-documentation-path https://www.swift.org/documentation/compiler/diagnostics/ 2>&1 | %FileCheck %s --check-prefix=CHECK-HTTPS -check-prefix CHECK
// RUN: %target-swift-frontend -typecheck %s -diagnostic-documentation-path https://docs.swift.org/compiler/documentation/diagnostics/ 2>&1 | %FileCheck %s --check-prefix=CHECK-HTTPS -check-prefix CHECK
// REQUIRES: swift_swift_parser
// CHECK: warning: file 'print-diagnostic-groups.swift' is part of module 'main'; ignoring import{{$}}
@@ -16,4 +16,4 @@ bar()
// CHECK-FILE: [#DeprecatedDeclarations]: <file://{{.*}}deprecated-declaration.md>
// CHECK-HTTPS: [#DeprecatedDeclaration]: <https://www.swift.org/documentation/compiler/diagnostics/deprecated-declaration.md>
// CHECK-HTTPS: [#DeprecatedDeclaration]: <https://docs.swift.org/compiler/documentation/diagnostics/deprecated-declaration>