rust-diplomat / diplomat

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code
https://rust-diplomat.github.io/book/
Other
480 stars 45 forks source link

Make C2TyGenContext public #502

Closed Manishearth closed 4 weeks ago

Manishearth commented 1 month ago

Otherwise this fails to compile on Rust 1.70 (ICU4X MSRV)

error[E0446]: crate-private type `c2::ty::TyGenContext<'ccx, 'tcx>` in public interface
   --> /home/runner/.cargo/git/checkouts/diplomat-6c8ebb579fc79396/656fd0a/tool/src/cpp2/ty.rs:126:5
    |
126 |     pub c: C2TyGenContext<'ccx, 'tcx>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type
    |
   ::: /home/runner/.cargo/git/checkouts/diplomat-6c8ebb579fc79396/656fd0a/tool/src/c2/ty.rs:111:1
    |
111 | pub(crate) struct TyGenContext<'cx, 'tcx> {
    | ----------------------------------------- `c2::ty::TyGenContext<'ccx, 'tcx>` declared as crate-private
robertbastian commented 4 weeks ago

Both TyGenContexts should be pub(crate)

robertbastian commented 4 weeks ago

I did this in #506