Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify MSRV in protobuf crate #746

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

varungandhi-src
Copy link

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

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 sourcegraph/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