mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Point at diagnostic group documentation on docs.swift.org
This commit is contained in:
@@ -2633,7 +2633,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);
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user