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

Could not compile protobuf due to errors #619

Closed
nathanduchesne opened this issue May 2, 2022 · 1 comment
Closed

Could not compile protobuf due to errors #619

nathanduchesne opened this issue May 2, 2022 · 1 comment

Comments

@nathanduchesne
Copy link

Hello all,
While trying to use this crate for a project, I encountered the following errors upon compiling:

Compiling protobuf v3.0.1
error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_input_stream/buf_read_iter.rs:334:45
|
334 | self.read_exact(&mut target.spare_capacity_mut()[..count])?;
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_output_stream/mod.rs:62:55
|
62 | let buffer = OutputBuffer::new(buffer_storage.spare_capacity_mut());
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_output_stream/mod.rs:88:44
|
88 | let buffer = OutputBuffer::new(vec.spare_capacity_mut());
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_output_stream/mod.rs:112:55
|
112 | self.buffer.replace_buffer_keep_pos(v.spare_capacity_mut());
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_output_stream/mod.rs:179:53
|
179 | self.buffer = OutputBuffer::new(vec.spare_capacity_mut());
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_output_stream/mod.rs:207:53
|
207 | self.buffer = OutputBuffer::new(vec.spare_capacity_mut());
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

error[E0658]: use of unstable library feature 'vec_spare_capacity'
--> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/protobuf-3.0.1/src/coded_output_stream/mod.rs:251:53
|
251 | self.buffer = OutputBuffer::new(vec.spare_capacity_mut());
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #75017 rust-lang/rust#75017 for more information

For more information about this error, try rustc --explain E0658.
error: could not compile protobuf due to 7 previous errors

In other words, this vec_spare_capacity method doesn't seem to be liked by my compiler and I was wondering if this was a known "problem" or if there are any ways of going around this.

To understand how to use the crate, I was greatly inspired by the snippets in https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-examples/pure-vs-protoc. Please let me know if there is anything more you would like to know or anything I can do.
Cheers,
Nathan

@stepancheg
Copy link
Owner

Vec::spare_capacity_mut was stabilized in Rust 1.60.0 (2022-04-07).

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

No branches or pull requests

2 participants