Я пытаюсь включить rust-rocksdb в приложение, использующее tokio 0.2 (так что async await), и пытаюсь скомпилировать с использованием 1.39.0-beta.1, я получаю следующие ошибки:
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:243:5
|
243 | pub __opaque: [libc::c_char; 56usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:282:5
|
282 | pub __opaque: [libc::c_char; 40usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 40]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 40]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 40]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:364:5
|
364 | pub __opaque: [libc::c_char; 56usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:487:5
|
487 | pub __opaque: [libc::c_char; 192usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 192]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 192]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 192]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:572:5
|
572 | pub __opaque: [libc::c_char; 8176usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 8176]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 8176]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 8176]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error: aborting due to 5 previous errors
Я также пробовал использовать nightly, и у меня такая же проблема, используя nightly 2019-09-20 и 2019-09-10, вместо этого он компилируется нормально.
Извините, если это не проблема с librocksdb-sys (возможно, это проблема с bingen), но я новичок в ржавчине, поэтому я не уверен на 100%, как это проверить.
Привет! Спасибо за создание проблемы. Нам известно об этой проблеме, и мы вынуждены отключить канал beta
на Трэвисе из-за этого.
Однако единственное решение, которое я могу вам предложить, - это перейти на компилятор stable
.
Причина в том, что эта проблема никогда не появится в стабильной версии, согласно https://doc.rust-lang.org/nightly/src/core/array.rs.html#385.
[нестабильный (feature = "const_generic_impls_guard", issue = "0",
reason = "will never be stable, just a temporary step until const generics are stable")]
@vitvakatu о, хорошо, спасибо! Я буду работать каждую ночь, пока 1.39 не станет стабильной, так как мне все еще нужно await / async.
Я закрою этот вопрос, потому что вы ничего не можете с этим поделать.
Я не могу собрать librocksdb-sys на бета-версии (мне также нужна бета-версия для async / await) ни на MacOS Mojave, ни на Xcode 11.1 (у меня есть MacPorts, а не brew).
Я получаю такую ошибку:
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:243:5
|
243 | pub __opaque: [libc::c_char; 56usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:282:5
|
282 | pub __opaque: [libc::c_char; 40usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 40]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 40]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 40]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:364:5
|
364 | pub __opaque: [libc::c_char; 56usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:487:5
|
487 | pub __opaque: [libc::c_char; 192usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 192]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 192]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 192]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error[E0277]: arrays only have std trait implementations for lengths 0..=32
--> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:572:5
|
572 | pub __opaque: [libc::c_char; 8176usize],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 8176]`
|
= note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 8176]`
= note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 8176]`
= note: required for the cast to the object type `dyn std::fmt::Debug`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.
Пожалуйста, порекомендуйте?
@cculianu Да. Это известная проблема. Попробуйте использовать librocksdb-sys
из master
.
Понятно. Значит, тогда это сработает?
Приносим извинения, но: я неравнодушен к миру ржавчины - я буквально просто пытаюсь скомпилировать проект, созданный моим соавтором, чтобы я мог заставить его работать в моей системе MacOS (он работает на стороне сервера, а я делаю клиент на совершенно другом языке). Я просто хочу, чтобы его сервер скомпилировался, чтобы я мог запустить его здесь ... без необходимости использовать виртуальную машину Linux (в Linux она компилируется отлично).
Я знаю, что могу это погуглить, но это пугает - мир Rust буквально нов для меня. Я разработчик C ++. :) Как мне заставить его спецификацию сборки использовать мастер, а не загружать нужный ящик? Когда я ввожу cargo build
в исходный каталог его проекта, он загружает ящик и пытается его собрать. Могу я отменить это?
Может стоит у него спросить .. :)
Думаю, я понял это - здесь я указываю его зависимость rockdb на ваш репозиторий, а не на 0.12.4.
Сейчас он строится ...
ZOMG это скомпилировано! СПАСИБО ЗА ВАШ ОТВЕТ. Буквально понятия не имел, что делать. Спасибо.
Самый полезный комментарий
ZOMG это скомпилировано! СПАСИБО ЗА ВАШ ОТВЕТ. Буквально понятия не имел, что делать. Спасибо.