Skip to content

Commit 1bf4873

Browse files
authored
Rollup merge of #70540 - jonas-schievink:link-attr-template, r=varkor
#[link]: mention wasm_import_module instead of cfg `#[link(cfg)]` is perma-unstable and is not documented anywhere else. It makes more sense to mention `wasm_import_module` here since it's stable. This makes it harder to hit #70538 (if it weren't for this text, I wouldn't even know this feature existed).
2 parents 5a7b377 + 042f494 commit 1bf4873

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_feature/builtin_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
220220
// ABI, linking, symbols, and FFI
221221
ungated!(
222222
link, Whitelisted,
223-
template!(List: r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...""#),
223+
template!(List: r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...""#),
224224
),
225225
ungated!(link_name, Whitelisted, template!(NameValueStr: "name")),
226226
ungated!(no_link, Normal, template!(Word)),

src/test/ui/malformed/malformed-regressions.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ LL | #[inline = ""]
2626
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2727
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
2828

29-
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
29+
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...")]`
3030
--> $DIR/malformed-regressions.rs:7:1
3131
|
3232
LL | #[link]
@@ -35,7 +35,7 @@ LL | #[link]
3535
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3636
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
3737

38-
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ cfg = "...")]`
38+
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...")]`
3939
--> $DIR/malformed-regressions.rs:9:1
4040
|
4141
LL | #[link = ""]

0 commit comments

Comments
 (0)