| author | bors <bors@rust-lang.org> 2026-06-22 11:48:19 UTC |
| committer | bors <bors@rust-lang.org> 2026-06-22 11:48:19 UTC |
| log | cddcbec198760511240bf0e728193bf4d700acb4 |
| tree | 36371d2b71c5c4b11c26604f3352f06716b2cb89 |
| parent | 9030e345fe92df1ccefd0a8cdf61a9a9a5b73cb0 |
| parent | 472c9f8f703dbf4b7ee98e51a1252a800df9a702 |
Specify target list for `#[export_stable]`
Work towards removing the `ALL_TARGETS` list.
r? @mejrs 6 files changed, 189 insertions(+), 149 deletions(-)
compiler/rustc_attr_parsing/src/attributes/link_attrs.rs+12-1| ... | ... | @@ -535,7 +535,18 @@ impl SingleAttributeParser for LinkSectionParser { |
| 535 | 535 | pub(crate) struct ExportStableParser; |
| 536 | 536 | impl NoArgsAttributeParser for ExportStableParser { |
| 537 | 537 | const PATH: &[Symbol] = &[sym::export_stable]; |
| 538 | const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs` | |
| 538 | const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ | |
| 539 | Allow(Target::Fn), | |
| 540 | Allow(Target::Method(MethodKind::Inherent)), | |
| 541 | Allow(Target::Struct), | |
| 542 | Allow(Target::Enum), | |
| 543 | Allow(Target::Union), | |
| 544 | Allow(Target::TyAlias), | |
| 545 | Allow(Target::AssocTy), | |
| 546 | Allow(Target::Use), | |
| 547 | Allow(Target::Mod), | |
| 548 | Allow(Target::Impl { of_trait: false }), | |
| 549 | ]); | |
| 539 | 550 | const STABILITY: AttributeStability = unstable!(export_stable); |
| 540 | 551 | const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ExportStable; |
| 541 | 552 | } |
compiler/rustc_passes/src/check_export.rs+3-1| ... | ... | @@ -147,7 +147,9 @@ impl<'tcx> Visitor<'tcx> for ExportableItemCollector<'tcx> { |
| 147 | 147 | hir::ItemKind::Impl(impl_) if impl_.of_trait.is_none() => { |
| 148 | 148 | unreachable!(); |
| 149 | 149 | } |
| 150 | _ => self.report_wrong_site(def_id), | |
| 150 | _ => { | |
| 151 | self.tcx.dcx().delayed_bug("Target is checked by attribute parser"); | |
| 152 | } | |
| 151 | 153 | } |
| 152 | 154 | } |
| 153 | 155 |
tests/ui/attributes/export/exportable.binary.stderr created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | error: `#[export_stable]` attribute cannot be used on traits | |
| 2 | --> $DIR/exportable.rs:135:5 | |
| 3 | | | |
| 4 | LL | #[export_stable] | |
| 5 | | ^^^^^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements | |
| 8 | ||
| 9 | error: `#[export_stable]` attribute cannot be used on constants | |
| 10 | --> $DIR/exportable.rs:139:5 | |
| 11 | | | |
| 12 | LL | #[export_stable] | |
| 13 | | ^^^^^^^^^^^^^^^^ | |
| 14 | | | |
| 15 | = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements | |
| 16 | ||
| 17 | error: aborting due to 2 previous errors | |
| 18 |
tests/ui/attributes/export/exportable.rs+22-17| ... | ... | @@ -1,6 +1,11 @@ |
| 1 | //@ revisions: sdylib binary | |
| 2 | // Currently the two revisions have different expectations, this is wrong. | |
| 3 | // There is an issue open to fix this: https://github.com/rust-lang/rust/issues/158227 | |
| 4 | ||
| 1 | 5 | //@ compile-flags: -Zunstable-options -Csymbol-mangling-version=v0 |
| 6 | //@[sdylib] compile-flags: --crate-type=sdylib | |
| 7 | //@[binary] compile-flags: --crate-type=bin | |
| 2 | 8 | |
| 3 | #![crate_type = "sdylib"] | |
| 4 | 9 | #![allow(incomplete_features, improper_ctypes_definitions)] |
| 5 | 10 | #![feature(export_stable)] |
| 6 | 11 | #![feature(inherent_associated_types)] |
| ... | ... | @@ -8,10 +13,10 @@ |
| 8 | 13 | mod m { |
| 9 | 14 | #[export_stable] |
| 10 | 15 | pub struct S; |
| 11 | //~^ ERROR private items are not exportable | |
| 16 | //[sdylib]~^ ERROR private items are not exportable | |
| 12 | 17 | |
| 13 | 18 | pub fn foo() -> i32 { 0 } |
| 14 | //~^ ERROR only functions with "C" ABI are exportable | |
| 19 | //[sdylib]~^ ERROR only functions with "C" ABI are exportable | |
| 15 | 20 | } |
| 16 | 21 | |
| 17 | 22 | #[export_stable] |
| ... | ... | @@ -25,13 +30,13 @@ pub mod m1 { |
| 25 | 30 | struct S2; |
| 26 | 31 | |
| 27 | 32 | pub struct S3; |
| 28 | //~^ ERROR types with unstable layout are not exportable | |
| 33 | //[sdylib]~^ ERROR types with unstable layout are not exportable | |
| 29 | 34 | } |
| 30 | 35 | |
| 31 | 36 | pub mod fn_sig { |
| 32 | 37 | #[export_stable] |
| 33 | 38 | pub fn foo1() {} |
| 34 | //~^ ERROR only functions with "C" ABI are exportable | |
| 39 | //[sdylib]~^ ERROR only functions with "C" ABI are exportable | |
| 35 | 40 | |
| 36 | 41 | #[export_stable] |
| 37 | 42 | #[repr(C)] |
| ... | ... | @@ -42,7 +47,7 @@ pub mod fn_sig { |
| 42 | 47 | |
| 43 | 48 | #[export_stable] |
| 44 | 49 | pub extern "C" fn foo3(x: Box<S>) -> i32 { 0 } |
| 45 | //~^ ERROR function with `#[export_stable]` attribute uses type `Box<fn_sig::S>`, which is not exportable | |
| 50 | //[sdylib]~^ ERROR function with `#[export_stable]` attribute uses type `Box<fn_sig::S>`, which is not exportable | |
| 46 | 51 | } |
| 47 | 52 | |
| 48 | 53 | pub mod impl_item { |
| ... | ... | @@ -51,11 +56,11 @@ pub mod impl_item { |
| 51 | 56 | impl S { |
| 52 | 57 | #[export_stable] |
| 53 | 58 | pub extern "C" fn foo1(&self) -> i32 { 0 } |
| 54 | //~^ ERROR method with `#[export_stable]` attribute uses type `&impl_item::S`, which is not exportable | |
| 59 | //[sdylib]~^ ERROR method with `#[export_stable]` attribute uses type `&impl_item::S`, which is not exportable | |
| 55 | 60 | |
| 56 | 61 | #[export_stable] |
| 57 | 62 | pub extern "C" fn foo2(self) -> i32 { 0 } |
| 58 | //~^ ERROR method with `#[export_stable]` attribute uses type `impl_item::S`, which is not exportable | |
| 63 | //[sdylib]~^ ERROR method with `#[export_stable]` attribute uses type `impl_item::S`, which is not exportable | |
| 59 | 64 | } |
| 60 | 65 | |
| 61 | 66 | pub struct S2<T>(T); |
| ... | ... | @@ -63,7 +68,7 @@ pub mod impl_item { |
| 63 | 68 | impl<T> S2<T> { |
| 64 | 69 | #[export_stable] |
| 65 | 70 | pub extern "C" fn foo1(&self) {} |
| 66 | //~^ ERROR generic functions are not exportable | |
| 71 | //[sdylib]~^ ERROR generic functions are not exportable | |
| 67 | 72 | } |
| 68 | 73 | } |
| 69 | 74 | |
| ... | ... | @@ -79,14 +84,14 @@ pub mod tys { |
| 79 | 84 | |
| 80 | 85 | #[export_stable] |
| 81 | 86 | pub extern "C" fn foo1(x: <S as Trait>::Type) -> u32 { x.0 } |
| 82 | //~^ ERROR function with `#[export_stable]` attribute uses type `(u32,)`, which is not exportable | |
| 87 | //[sdylib]~^ ERROR function with `#[export_stable]` attribute uses type `(u32,)`, which is not exportable | |
| 83 | 88 | |
| 84 | 89 | #[export_stable] |
| 85 | 90 | pub type Type = [i32; 4]; |
| 86 | 91 | |
| 87 | 92 | #[export_stable] |
| 88 | 93 | pub extern "C" fn foo2(_x: Type) {} |
| 89 | //~^ ERROR function with `#[export_stable]` attribute uses type `[i32; 4]`, which is not exportable | |
| 94 | //[sdylib]~^ ERROR function with `#[export_stable]` attribute uses type `[i32; 4]`, which is not exportable | |
| 90 | 95 | |
| 91 | 96 | impl S { |
| 92 | 97 | #[export_stable] |
| ... | ... | @@ -95,11 +100,11 @@ pub mod tys { |
| 95 | 100 | |
| 96 | 101 | #[export_stable] |
| 97 | 102 | pub extern "C" fn foo3(_x: S::Type) {} |
| 98 | //~^ ERROR function with `#[export_stable]` attribute uses type `extern "C" fn()`, which is not exportable | |
| 103 | //[sdylib]~^ ERROR function with `#[export_stable]` attribute uses type `extern "C" fn()`, which is not exportable | |
| 99 | 104 | |
| 100 | 105 | #[export_stable] |
| 101 | 106 | pub extern "C" fn foo4() -> impl Copy { |
| 102 | //~^ ERROR function with `#[export_stable]` attribute uses type `impl Copy`, which is not exportable | |
| 107 | //[sdylib]~^ ERROR function with `#[export_stable]` attribute uses type `impl Copy`, which is not exportable | |
| 103 | 108 | 0 |
| 104 | 109 | } |
| 105 | 110 | } |
| ... | ... | @@ -114,26 +119,26 @@ pub mod privacy { |
| 114 | 119 | #[export_stable] |
| 115 | 120 | #[repr(C)] |
| 116 | 121 | pub struct S2 { |
| 117 | //~^ ERROR ADT types with private fields are not exportable | |
| 122 | //[sdylib]~^ ERROR ADT types with private fields are not exportable | |
| 118 | 123 | x: i32 |
| 119 | 124 | } |
| 120 | 125 | |
| 121 | 126 | #[export_stable] |
| 122 | 127 | #[repr(i32)] |
| 123 | 128 | enum E { |
| 124 | //~^ ERROR private items are not exportable | |
| 129 | //[sdylib]~^ ERROR private items are not exportable | |
| 125 | 130 | Variant1 { x: i32 } |
| 126 | 131 | } |
| 127 | 132 | } |
| 128 | 133 | |
| 129 | 134 | pub mod use_site { |
| 130 | 135 | #[export_stable] |
| 136 | //~^ ERROR cannot be used on | |
| 131 | 137 | pub trait Trait {} |
| 132 | //~^ ERROR trait's are not exportable | |
| 133 | 138 | |
| 134 | 139 | #[export_stable] |
| 140 | //~^ ERROR cannot be used on | |
| 135 | 141 | pub const C: i32 = 0; |
| 136 | //~^ ERROR constant's are not exportable | |
| 137 | 142 | } |
| 138 | 143 | |
| 139 | 144 | fn main() {} |
tests/ui/attributes/export/exportable.sdylib.stderr created+134| ... | ... | @@ -0,0 +1,134 @@ |
| 1 | error: `#[export_stable]` attribute cannot be used on traits | |
| 2 | --> $DIR/exportable.rs:135:5 | |
| 3 | | | |
| 4 | LL | #[export_stable] | |
| 5 | | ^^^^^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements | |
| 8 | ||
| 9 | error: `#[export_stable]` attribute cannot be used on constants | |
| 10 | --> $DIR/exportable.rs:139:5 | |
| 11 | | | |
| 12 | LL | #[export_stable] | |
| 13 | | ^^^^^^^^^^^^^^^^ | |
| 14 | | | |
| 15 | = help: `#[export_stable]` can be applied to associated types, data types, functions, inherent impl blocks, modules, type aliases, and use statements | |
| 16 | ||
| 17 | error: private items are not exportable | |
| 18 | --> $DIR/exportable.rs:15:5 | |
| 19 | | | |
| 20 | LL | pub struct S; | |
| 21 | | ^^^^^^^^^^^^ | |
| 22 | | | |
| 23 | note: is only usable at visibility `pub(crate)` | |
| 24 | --> $DIR/exportable.rs:15:5 | |
| 25 | | | |
| 26 | LL | pub struct S; | |
| 27 | | ^^^^^^^^^^^^ | |
| 28 | ||
| 29 | error: private items are not exportable | |
| 30 | --> $DIR/exportable.rs:128:5 | |
| 31 | | | |
| 32 | LL | enum E { | |
| 33 | | ^^^^^^ | |
| 34 | | | |
| 35 | note: is only usable at visibility `pub(self)` | |
| 36 | --> $DIR/exportable.rs:128:5 | |
| 37 | | | |
| 38 | LL | enum E { | |
| 39 | | ^^^^^^ | |
| 40 | ||
| 41 | error: only functions with "C" ABI are exportable | |
| 42 | --> $DIR/exportable.rs:18:5 | |
| 43 | | | |
| 44 | LL | pub fn foo() -> i32 { 0 } | |
| 45 | | ^^^^^^^^^^^^^^^^^^^ | |
| 46 | ||
| 47 | error: types with unstable layout are not exportable | |
| 48 | --> $DIR/exportable.rs:32:5 | |
| 49 | | | |
| 50 | LL | pub struct S3; | |
| 51 | | ^^^^^^^^^^^^^ | |
| 52 | ||
| 53 | error: only functions with "C" ABI are exportable | |
| 54 | --> $DIR/exportable.rs:38:5 | |
| 55 | | | |
| 56 | LL | pub fn foo1() {} | |
| 57 | | ^^^^^^^^^^^^^ | |
| 58 | ||
| 59 | error: function with `#[export_stable]` attribute uses type `Box<fn_sig::S>`, which is not exportable | |
| 60 | --> $DIR/exportable.rs:49:5 | |
| 61 | | | |
| 62 | LL | pub extern "C" fn foo3(x: Box<S>) -> i32 { 0 } | |
| 63 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^------^^^^^^^^ | |
| 64 | | | | |
| 65 | | not exportable | |
| 66 | ||
| 67 | error: method with `#[export_stable]` attribute uses type `&impl_item::S`, which is not exportable | |
| 68 | --> $DIR/exportable.rs:58:9 | |
| 69 | | | |
| 70 | LL | pub extern "C" fn foo1(&self) -> i32 { 0 } | |
| 71 | | ^^^^^^^^^^^^^^^^^^^^^^^-----^^^^^^^^ | |
| 72 | | | | |
| 73 | | not exportable | |
| 74 | ||
| 75 | error: method with `#[export_stable]` attribute uses type `impl_item::S`, which is not exportable | |
| 76 | --> $DIR/exportable.rs:62:9 | |
| 77 | | | |
| 78 | LL | pub extern "C" fn foo2(self) -> i32 { 0 } | |
| 79 | | ^^^^^^^^^^^^^^^^^^^^^^^----^^^^^^^^ | |
| 80 | | | | |
| 81 | | not exportable | |
| 82 | ||
| 83 | error: generic functions are not exportable | |
| 84 | --> $DIR/exportable.rs:70:9 | |
| 85 | | | |
| 86 | LL | pub extern "C" fn foo1(&self) {} | |
| 87 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 88 | ||
| 89 | error: function with `#[export_stable]` attribute uses type `(u32,)`, which is not exportable | |
| 90 | --> $DIR/exportable.rs:86:5 | |
| 91 | | | |
| 92 | LL | pub extern "C" fn foo1(x: <S as Trait>::Type) -> u32 { x.0 } | |
| 93 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^------------------^^^^^^^^ | |
| 94 | | | | |
| 95 | | not exportable | |
| 96 | ||
| 97 | error: function with `#[export_stable]` attribute uses type `[i32; 4]`, which is not exportable | |
| 98 | --> $DIR/exportable.rs:93:5 | |
| 99 | | | |
| 100 | LL | pub extern "C" fn foo2(_x: Type) {} | |
| 101 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^----^ | |
| 102 | | | | |
| 103 | | not exportable | |
| 104 | ||
| 105 | error: function with `#[export_stable]` attribute uses type `extern "C" fn()`, which is not exportable | |
| 106 | --> $DIR/exportable.rs:102:5 | |
| 107 | | | |
| 108 | LL | pub extern "C" fn foo3(_x: S::Type) {} | |
| 109 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^ | |
| 110 | | | | |
| 111 | | not exportable | |
| 112 | ||
| 113 | error: function with `#[export_stable]` attribute uses type `impl Copy`, which is not exportable | |
| 114 | --> $DIR/exportable.rs:106:5 | |
| 115 | | | |
| 116 | LL | pub extern "C" fn foo4() -> impl Copy { | |
| 117 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------- | |
| 118 | | | | |
| 119 | | not exportable | |
| 120 | ||
| 121 | error: ADT types with private fields are not exportable | |
| 122 | --> $DIR/exportable.rs:121:5 | |
| 123 | | | |
| 124 | LL | pub struct S2 { | |
| 125 | | ^^^^^^^^^^^^^ | |
| 126 | | | |
| 127 | note: `x` is private | |
| 128 | --> $DIR/exportable.rs:123:9 | |
| 129 | | | |
| 130 | LL | x: i32 | |
| 131 | | ^^^^^^ | |
| 132 | ||
| 133 | error: aborting due to 16 previous errors | |
| 134 |
tests/ui/attributes/export/exportable.stderr deleted-130| ... | ... | @@ -1,130 +0,0 @@ |
| 1 | error: private items are not exportable | |
| 2 | --> $DIR/exportable.rs:10:5 | |
| 3 | | | |
| 4 | LL | pub struct S; | |
| 5 | | ^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | note: is only usable at visibility `pub(crate)` | |
| 8 | --> $DIR/exportable.rs:10:5 | |
| 9 | | | |
| 10 | LL | pub struct S; | |
| 11 | | ^^^^^^^^^^^^ | |
| 12 | ||
| 13 | error: private items are not exportable | |
| 14 | --> $DIR/exportable.rs:123:5 | |
| 15 | | | |
| 16 | LL | enum E { | |
| 17 | | ^^^^^^ | |
| 18 | | | |
| 19 | note: is only usable at visibility `pub(self)` | |
| 20 | --> $DIR/exportable.rs:123:5 | |
| 21 | | | |
| 22 | LL | enum E { | |
| 23 | | ^^^^^^ | |
| 24 | ||
| 25 | error: trait's are not exportable | |
| 26 | --> $DIR/exportable.rs:131:5 | |
| 27 | | | |
| 28 | LL | pub trait Trait {} | |
| 29 | | ^^^^^^^^^^^^^^^ | |
| 30 | ||
| 31 | error: constant's are not exportable | |
| 32 | --> $DIR/exportable.rs:135:5 | |
| 33 | | | |
| 34 | LL | pub const C: i32 = 0; | |
| 35 | | ^^^^^^^^^^^^^^^^ | |
| 36 | ||
| 37 | error: only functions with "C" ABI are exportable | |
| 38 | --> $DIR/exportable.rs:13:5 | |
| 39 | | | |
| 40 | LL | pub fn foo() -> i32 { 0 } | |
| 41 | | ^^^^^^^^^^^^^^^^^^^ | |
| 42 | ||
| 43 | error: types with unstable layout are not exportable | |
| 44 | --> $DIR/exportable.rs:27:5 | |
| 45 | | | |
| 46 | LL | pub struct S3; | |
| 47 | | ^^^^^^^^^^^^^ | |
| 48 | ||
| 49 | error: only functions with "C" ABI are exportable | |
| 50 | --> $DIR/exportable.rs:33:5 | |
| 51 | | | |
| 52 | LL | pub fn foo1() {} | |
| 53 | | ^^^^^^^^^^^^^ | |
| 54 | ||
| 55 | error: function with `#[export_stable]` attribute uses type `Box<fn_sig::S>`, which is not exportable | |
| 56 | --> $DIR/exportable.rs:44:5 | |
| 57 | | | |
| 58 | LL | pub extern "C" fn foo3(x: Box<S>) -> i32 { 0 } | |
| 59 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^------^^^^^^^^ | |
| 60 | | | | |
| 61 | | not exportable | |
| 62 | ||
| 63 | error: method with `#[export_stable]` attribute uses type `&impl_item::S`, which is not exportable | |
| 64 | --> $DIR/exportable.rs:53:9 | |
| 65 | | | |
| 66 | LL | pub extern "C" fn foo1(&self) -> i32 { 0 } | |
| 67 | | ^^^^^^^^^^^^^^^^^^^^^^^-----^^^^^^^^ | |
| 68 | | | | |
| 69 | | not exportable | |
| 70 | ||
| 71 | error: method with `#[export_stable]` attribute uses type `impl_item::S`, which is not exportable | |
| 72 | --> $DIR/exportable.rs:57:9 | |
| 73 | | | |
| 74 | LL | pub extern "C" fn foo2(self) -> i32 { 0 } | |
| 75 | | ^^^^^^^^^^^^^^^^^^^^^^^----^^^^^^^^ | |
| 76 | | | | |
| 77 | | not exportable | |
| 78 | ||
| 79 | error: generic functions are not exportable | |
| 80 | --> $DIR/exportable.rs:65:9 | |
| 81 | | | |
| 82 | LL | pub extern "C" fn foo1(&self) {} | |
| 83 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 84 | ||
| 85 | error: function with `#[export_stable]` attribute uses type `(u32,)`, which is not exportable | |
| 86 | --> $DIR/exportable.rs:81:5 | |
| 87 | | | |
| 88 | LL | pub extern "C" fn foo1(x: <S as Trait>::Type) -> u32 { x.0 } | |
| 89 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^------------------^^^^^^^^ | |
| 90 | | | | |
| 91 | | not exportable | |
| 92 | ||
| 93 | error: function with `#[export_stable]` attribute uses type `[i32; 4]`, which is not exportable | |
| 94 | --> $DIR/exportable.rs:88:5 | |
| 95 | | | |
| 96 | LL | pub extern "C" fn foo2(_x: Type) {} | |
| 97 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^----^ | |
| 98 | | | | |
| 99 | | not exportable | |
| 100 | ||
| 101 | error: function with `#[export_stable]` attribute uses type `extern "C" fn()`, which is not exportable | |
| 102 | --> $DIR/exportable.rs:97:5 | |
| 103 | | | |
| 104 | LL | pub extern "C" fn foo3(_x: S::Type) {} | |
| 105 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^ | |
| 106 | | | | |
| 107 | | not exportable | |
| 108 | ||
| 109 | error: function with `#[export_stable]` attribute uses type `impl Copy`, which is not exportable | |
| 110 | --> $DIR/exportable.rs:101:5 | |
| 111 | | | |
| 112 | LL | pub extern "C" fn foo4() -> impl Copy { | |
| 113 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------- | |
| 114 | | | | |
| 115 | | not exportable | |
| 116 | ||
| 117 | error: ADT types with private fields are not exportable | |
| 118 | --> $DIR/exportable.rs:116:5 | |
| 119 | | | |
| 120 | LL | pub struct S2 { | |
| 121 | | ^^^^^^^^^^^^^ | |
| 122 | | | |
| 123 | note: `x` is private | |
| 124 | --> $DIR/exportable.rs:118:9 | |
| 125 | | | |
| 126 | LL | x: i32 | |
| 127 | | ^^^^^^ | |
| 128 | ||
| 129 | error: aborting due to 16 previous errors | |
| 130 |