diff options
| author | Bryanskiy <ivakin.kir@gmail.com> | 2024-09-30 21:07:36 +0300 |
|---|---|---|
| committer | Bryanskiy <ivakin.kir@gmail.com> | 2025-05-04 22:03:15 +0300 |
| commit | 14535312b522c0524dd94633cc6a49992b12cecd (patch) | |
| tree | f397262aa2e597623ac7dc9a721da0360398808d /tests/run-make/export/disambiguator/libr.rs | |
| parent | 62c5f58f57670ce65e7fec34f8c4ba00c27da2d9 (diff) | |
| download | rust-14535312b522c0524dd94633cc6a49992b12cecd.tar.gz rust-14535312b522c0524dd94633cc6a49992b12cecd.zip | |
Initial support for dynamically linked crates
Diffstat (limited to 'tests/run-make/export/disambiguator/libr.rs')
| -rw-r--r-- | tests/run-make/export/disambiguator/libr.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/run-make/export/disambiguator/libr.rs b/tests/run-make/export/disambiguator/libr.rs new file mode 100644 index 00000000000..b294d5c9e8e --- /dev/null +++ b/tests/run-make/export/disambiguator/libr.rs @@ -0,0 +1,27 @@ +// `S::<S2>::foo` and `S::<S1>::foo` have same `DefPath` modulo disambiguator. +// `libr.rs` interface may not contain `S::<S1>::foo` as private items aren't +// exportable. We should make sure that original `S::<S2>::foo` and the one +// produced during interface generation have same mangled names. + +#![feature(export_stable)] +#![crate_type = "sdylib"] + +#[export_stable] +#[repr(C)] +pub struct S<T>(pub T); + +struct S1; +pub struct S2; + +impl S<S1> { + extern "C" fn foo() -> i32 { + 1 + } +} + +#[export_stable] +impl S<S2> { + pub extern "C" fn foo() -> i32 { + 2 + } +} |
