Skip to content

Commit 506bd7d

Browse files
authored
Unrolled build for #143193
Rollup merge of #143193 - JonathanBrouwer:link_rework, r=jdonszelmann Port `#[link]` to the new attribute parsing infrastructure Ports `link` to the new attribute parsing infrastructure for #131229 (comment)
2 parents b416342 + 7db1840 commit 506bd7d

File tree

60 files changed

+1700
-1078
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1700
-1078
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,6 +3480,7 @@ dependencies = [
34803480
"rustc_parse",
34813481
"rustc_session",
34823482
"rustc_span",
3483+
"rustc_target",
34833484
"thin-vec",
34843485
]
34853486

compiler/rustc_attr_parsing/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ rustc_macros = { path = "../rustc_macros" }
1717
rustc_parse = { path = "../rustc_parse" }
1818
rustc_session = { path = "../rustc_session" }
1919
rustc_span = { path = "../rustc_span" }
20+
rustc_target = { path = "../rustc_target" }
2021
thin-vec.workspace = true
2122
# tidy-alphabetical-end

compiler/rustc_attr_parsing/messages.ftl

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,55 @@ attr_parsing_invalid_meta_item = expected a literal (`1u8`, `1.0f32`, `"string"`
195195
196196
attr_parsing_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
197197
.help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
198+
199+
attr_parsing_as_needed_compatibility =
200+
linking modifier `as-needed` is only compatible with `dylib` and `framework` linking kinds
201+
202+
attr_parsing_bundle_needs_static =
203+
linking modifier `bundle` is only compatible with `static` linking kind
204+
205+
attr_parsing_empty_link_name =
206+
link name must not be empty
207+
.label = empty link name
208+
209+
attr_parsing_import_name_type_raw =
210+
import name type can only be used with link kind `raw-dylib`
211+
212+
attr_parsing_import_name_type_x86 =
213+
import name type is only supported on x86
214+
215+
attr_parsing_incompatible_wasm_link =
216+
`wasm_import_module` is incompatible with other arguments in `#[link]` attributes
217+
218+
attr_parsing_invalid_link_modifier =
219+
invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed
220+
221+
attr_parsing_link_arg_unstable =
222+
link kind `link-arg` is unstable
223+
224+
attr_parsing_link_cfg_unstable =
225+
link cfg is unstable
226+
227+
attr_parsing_link_framework_apple =
228+
link kind `framework` is only supported on Apple targets
229+
230+
attr_parsing_link_requires_name =
231+
`#[link]` attribute requires a `name = "string"` argument
232+
.label = missing `name` argument
233+
234+
attr_parsing_multiple_modifiers =
235+
multiple `{$modifier}` modifiers in a single `modifiers` argument
236+
237+
attr_parsing_multiple_renamings =
238+
multiple renamings were specified for library `{$lib_name}`
239+
attr_parsing_raw_dylib_no_nul =
240+
link name must not contain NUL characters if link kind is `raw-dylib`
241+
242+
attr_parsing_raw_dylib_elf_unstable =
243+
link kind `raw-dylib` is unstable on ELF platforms
244+
245+
attr_parsing_raw_dylib_only_windows =
246+
link kind `raw-dylib` is only supported on Windows targets
247+
248+
attr_parsing_whole_archive_needs_static =
249+
linking modifier `whole-archive` is only compatible with `static` linking kind

compiler/rustc_attr_parsing/src/attributes/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn parse_cfg_attr<'c, S: Stage>(
3636
parse_cfg_entry(cx, single)
3737
}
3838

39-
fn parse_cfg_entry<S: Stage>(
39+
pub(crate) fn parse_cfg_entry<S: Stage>(
4040
cx: &mut AcceptContext<'_, '_, S>,
4141
item: &MetaItemOrLitParser<'_>,
4242
) -> Option<CfgEntry> {

0 commit comments

Comments
 (0)