diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2023-08-04 11:29:41 -0400 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2023-08-04 11:33:43 -0400 |
| commit | 7a0e2ee133dacf4e2dbda64a316a95746a469c58 (patch) | |
| tree | 2eff03091fc159afd4e575d95a486ef8eb27d9e4 /tests/ui/proc-macro | |
| parent | 3000c24afc37fe09c65772a71331002a7505dc11 (diff) | |
| download | rust-7a0e2ee133dacf4e2dbda64a316a95746a469c58.tar.gz rust-7a0e2ee133dacf4e2dbda64a316a95746a469c58.zip | |
regression test for issue 111888.
Diffstat (limited to 'tests/ui/proc-macro')
| -rw-r--r-- | tests/ui/proc-macro/auxiliary/exports_no_mangle.rs | 9 | ||||
| -rw-r--r-- | tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs | 20 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs b/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs new file mode 100644 index 00000000000..ef5bf94b035 --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs @@ -0,0 +1,9 @@ +#![crate_type="lib"] + +// Issue 111888: this crate (1.) is imported by a proc-macro crate and (2.) +// exports a no_mangle function; that combination of acts was broken for some +// period of time. See further discussion in the test file that imports this +// crate. + +#[no_mangle] +pub fn some_no_mangle_function() { } diff --git a/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs b/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs new file mode 100644 index 00000000000..087c9a2f065 --- /dev/null +++ b/tests/ui/proc-macro/no-mangle-in-proc-macro-issue-111888.rs @@ -0,0 +1,20 @@ +// run-pass +// aux-build:exports_no_mangle.rs +#![crate_type = "proc-macro"] + +// Issue #111888: this proc-macro crate imports another crate that itself +// exports a no_mangle function. +// +// That combination was broken for a period of time, because: +// +// In PR #99944 we *stopped* exporting no_mangle symbols from +// proc-macro crates. The constructed linker version script still referred +// to them, but resolving that discrepancy was left as a FIXME in the code. +// +// In PR #108017 we started telling the linker to check (via the +// `--no-undefined-version` linker invocation flag) that every symbol referenced +// in the "linker version script" is actually present in the linker input. So +// the unresolved discrepancy from #99944 started surfacing as a compile-time +// error. + +extern crate exports_no_mangle; |
