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

Fix private type in exported type paremater bound. #32

Closed
wants to merge 1 commit into from

Conversation

jansegre
Copy link
Contributor

With rustc 0.12.0-nightly (94b0aace1 2014-09-27 23:12:54 +0000) the following error occurs:

src/lib/rt.rs:91:36: 91:37 error: private type in exported type parameter bound
src/lib/rt.rs:91 pub fn vec_packed_varint_data_size<T : ProtobufVarint>(vec: &[T]) -> u32 {
                                                    ^
src/lib/rt.rs:96:43: 96:44 error: private type in exported type parameter bound
src/lib/rt.rs:96 pub fn vec_packed_varint_zigzag_data_size<T : ProtobufVarintZigzag>(vec: &[T]) -> u32 {
                                                           ^
src/lib/rt.rs:101:31: 101:32 error: private type in exported type parameter bound
src/lib/rt.rs:101 pub fn vec_packed_varint_size<T : ProtobufVarint>(field_number: u32, vec: &[T]) -> u32 {
                                                ^
src/lib/rt.rs:111:38: 111:39 error: private type in exported type parameter bound
src/lib/rt.rs:111 pub fn vec_packed_varint_zigzag_size<T : ProtobufVarintZigzag>(field_number: u32, vec: &[T]) -> u32 {
                                                       ^
src/lib/rt.rs:125:26: 125:27 error: private type in exported type parameter bound
src/lib/rt.rs:125 pub fn value_size_no_tag<T : ProtobufVarint>(value: T, wt: wire_format::WireType) -> u32 {
                                           ^
src/lib/rt.rs:134:19: 134:20 error: private type in exported type parameter bound
src/lib/rt.rs:134 pub fn value_size<T : ProtobufVarint>(field_number: u32, value: T, wt: wire_format::WireType) -> u32 {
                                    ^
error: aborting due to 6 previous errors
Could not compile `protobuf`.

This commit aims to fix it. The drawbacks are that ProtobufVarint and ProtobufVarintZigzag are now public, which is what the compiler is trying to enforce.

@stepancheg
Copy link
Owner

Request merged, code still does not compile due to rust-lang/rust#17767

@stepancheg stepancheg closed this Oct 4, 2014
@jansegre jansegre deleted the nightly-fixes branch November 3, 2014 21:58
jxs pushed a commit to jxs/rust-protobuf that referenced this pull request Oct 25, 2022
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.

None yet

2 participants