Skip to content

Specify MSRV in protobuf crate - #746

Open
varungandhi-src wants to merge 1 commit into
stepancheg:masterfrom
varungandhi-src:patch-1
Open

Specify MSRV in protobuf crate#746
varungandhi-src wants to merge 1 commit into
stepancheg:masterfrom
varungandhi-src:patch-1

Conversation

@varungandhi-src

@varungandhi-src varungandhi-src commented Oct 17, 2024

Copy link
Copy Markdown

The protobuf-codegen crate fails to compile
with Rust 1.71.0 due to code in this crate,
so mark the MSRV in this crate correctly,
based on bisecting across major Rust versions.

rust-version docs

Error message on compiling with older versions:

error[E0445]: crate-private trait `MapFieldAccessor` in public interface
   --> /Users/varun/.local/share/mise/installs/rust/1.71.0/registry/src/index.crates.io-6f17d22bba15001f/protobuf-3.7.1/src/reflect/acc/v2/map.rs:115:1
    |
17  |   pub(crate) trait MapFieldAccessor: Send + Sync + 'static {
    |   -------------------------------------------------------- `MapFieldAccessor` declared as crate-private
...
115 | / pub fn make_map_simpler_accessor_new<M, T>(
116 | |     name: &'static str,
117 | |     get_field: for<'a> fn(&'a M) -> &'a T,
118 | |     mut_field: for<'a> fn(&'a mut M) -> &'a mut T,
...   |
121 | |     M: MessageFull,
122 | |     MapFieldAccessorImpl<M, T>: MapFieldAccessor,
    | |_________________________________________________^ can't leak crate-private trait

error[E0446]: private type `MapFieldAccessorImpl<M, T>` in public interface
   --> /Users/varun/.local/share/mise/installs/rust/1.71.0/registry/src/index.crates.io-6f17d22bba15001f/protobuf-3.7.1/src/reflect/acc/v2/map.rs:115:1
    |
33  |   struct MapFieldAccessorImpl<M, T>
    |   --------------------------------- `MapFieldAccessorImpl<M, T>` declared as private
...
115 | / pub fn make_map_simpler_accessor_new<M, T>(
116 | |     name: &'static str,
117 | |     get_field: for<'a> fn(&'a M) -> &'a T,
118 | |     mut_field: for<'a> fn(&'a mut M) -> &'a mut T,
...   |
121 | |     M: MessageFull,
122 | |     MapFieldAccessorImpl<M, T>: MapFieldAccessor,
    | |_________________________________________________^ can't leak private type

Some errors have detailed explanations: E0445, E0446.
For more information about an error, try `rustc --explain E0445`.

Originally detected in scip-code/scip#284 (comment)

The protobuf-codegen crate fails to compile
with Rust 1.71.0 due to code in this crate,
so mark the MSRV in this crate correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants