Skip to content

Commit 901d3f8

Browse files
authored
Merge pull request #67886 from bnbarham/5.9-update-macro-help
[5.9] Update macro help in driver and diagnostics
2 parents 1ce02ad + 2417227 commit 901d3f8

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7113,9 +7113,7 @@ ERROR(macro_undefined,PointsToFirstBadToken,
71137113
"no macro named %0", (Identifier))
71147114
ERROR(external_macro_not_found,none,
71157115
"external macro implementation type '%0.%1' could not be found for "
7116-
"macro %2; the type must be public and provided by a macro target in a "
7117-
"Swift package, or via '-plugin-path' or '-load-plugin-library'",
7118-
(StringRef, StringRef, DeclName))
7116+
"macro %2", (StringRef, StringRef, DeclName))
71197117
ERROR(macro_must_be_defined,none,
71207118
"macro %0 requires a definition", (DeclName))
71217119
ERROR(external_macro_outside_macro_definition,none,

include/swift/Option/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,8 +1823,8 @@ def load_plugin_library:
18231823
def load_plugin_executable:
18241824
Separate<["-"], "load-plugin-executable">, Group<plugin_search_Group>,
18251825
Flags<[FrontendOption, DoesNotAffectIncrementalBuild, ArgumentIsPath]>,
1826-
HelpText<"Path to an executable compiler plugins and providing module names "
1827-
"such as macros">,
1826+
HelpText<"Path to a compiler plugin executable and a comma-separated list "
1827+
"of module names where the macro types are declared">,
18281828
MetaVarName<"<path>#<module-names>">;
18291829

18301830
include "FrontendOptions.td"

test/Macros/macro_plugin_broken.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
// RUN: c-index-test -read-diagnostics %t/macro_expand.dia 2>&1 | %FileCheck -check-prefix CHECK %s
2121

2222
// CHECK: (null):0:0: warning: compiler plugin not loaded: {{.+}}broken-plugin; failed to initialize
23-
// CHECK: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro';
24-
// CHECK: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro';
23+
// CHECK: test.swift:1:33: warning: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'
24+
// CHECK: test.swift:4:7: error: external macro implementation type 'TestPlugin.FooMacro' could not be found for macro 'fooMacro'
2525
// CHECK: +-{{.+}}test.swift:1:33: note: 'fooMacro' declared here
2626

2727
//--- test.swift

test/Macros/macros_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func shadow(a: Int, b: Int, stringify: Int) {
136136
}
137137

138138
func testMissing() {
139-
#missingMacro1("hello") // expected-error{{external macro implementation type 'MissingModule.MissingType' could not be found for macro 'missingMacro1'; the type must be public and provided by a macro target in a Swift package, or via '-plugin-path' or '-load-plugin-library'}}
139+
#missingMacro1("hello") // expected-error{{external macro implementation type 'MissingModule.MissingType' could not be found for macro 'missingMacro1'}}
140140
}
141141

142142
@freestanding(expression) macro undefined() // expected-error{{macro 'undefined()' requires a definition}}

0 commit comments

Comments
 (0)