Skip to content

bug: Can't build kreuzberg since version 4.4.1 #622

Description

@7sedam7

i still can't build a single version after 4.4.1.

error[E0308]: mismatched types
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extraction/docx/parser.rs:1174:37
     |
1172 | ...                   match attr.value.as_ref() {
     |                             ------------------- this expression has type `&[u8; 5]`
1173 | ...                       b"begin" => in_field_instruction = true,
1174 | ...                       b"separate" | b"end" => in_field_instruction = false,
     |                           ^^^^^^^^^^^ expected an array with a size of 5, found one with a size of 8

error[E0308]: mismatched types
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extraction/docx/parser.rs:1174:51
     |
1172 | ...                   match attr.value.as_ref() {
     |                             ------------------- this expression has type `&[u8; 5]`
1173 | ...                       b"begin" => in_field_instruction = true,
1174 | ...                       b"separate" | b"end" => in_field_instruction = false,
     |                                         ^^^^^^ expected an array with a size of 5, found one with a size of 3

   Compiling ignore v0.4.25
   Compiling osakit v0.3.1
error[E0277]: the trait bound `std::borrow::Cow<'_, [u8]>: AsRef<[u8; 5]>` is not satisfied
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extraction/docx/parser.rs:1172:50
     |
1172 | ...                   match attr.value.as_ref() {
     |                                        ^^^^^^ the trait `AsRef<[u8; 5]>` is not implemented for `std::borrow::Cow<'_, [u8]>`
     |
help: the following other types implement trait `AsRef<T>`
    --> /Users/joelkunst/.rustup/toolchains/1.94.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/path.rs:3770:1
     |
3770 |   impl AsRef<Path> for Cow<'_, OsStr> {
     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::borrow::Cow<'_, OsStr>` implements `AsRef<Path>`
     |
    ::: /Users/joelkunst/.rustup/toolchains/1.94.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/borrow.rs:459:1
     |
 459 |   impl<T: ?Sized + ToOwned> AsRef<T> for Cow<'_, T>
     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::borrow::Cow<'_, T>` implements `AsRef<T>`
     |
    ::: /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/typed-path-0.12.2/src/common/non_utf8/path.rs:1058:1
     |
1058 | / impl<T> AsRef<Path<T>> for Cow<'_, [u8]>
1059 | | where
1060 | |     T: Encoding,
     | |________________^ `std::borrow::Cow<'_, [u8]>` implements `AsRef<typed_path::common::non_utf8::path::Path<T>>`
     |
    ::: /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/typed-path-0.12.2/src/common/utf8/path.rs:1070:1
     |
1070 | / impl<T> AsRef<Utf8Path<T>> for Cow<'_, str>
1071 | | where
1072 | |     T: Utf8Encoding,
     | |____________________^ `std::borrow::Cow<'_, str>` implements `AsRef<typed_path::common::utf8::path::Utf8Path<T>>`

error[E0308]: mismatched types
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extraction/docx/parser.rs:1308:37
     |
1306 | ...                   match attr.value.as_ref() {
     |                             ------------------- this expression has type `&[u8; 5]`
1307 | ...                       b"begin" => in_field_instruction = true,
1308 | ...                       b"separate" | b"end" => in_field_instruction = false,
     |                           ^^^^^^^^^^^ expected an array with a size of 5, found one with a size of 8

error[E0308]: mismatched types
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extraction/docx/parser.rs:1308:51
     |
1306 | ...                   match attr.value.as_ref() {
     |                             ------------------- this expression has type `&[u8; 5]`
1307 | ...                       b"begin" => in_field_instruction = true,
1308 | ...                       b"separate" | b"end" => in_field_instruction = false,
     |                                         ^^^^^^ expected an array with a size of 5, found one with a size of 3

error[E0277]: the trait bound `std::borrow::Cow<'_, [u8]>: AsRef<[u8; 5]>` is not satisfied
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extraction/docx/parser.rs:1306:50
     |
1306 | ...                   match attr.value.as_ref() {
     |                                        ^^^^^^ the trait `AsRef<[u8; 5]>` is not implemented for `std::borrow::Cow<'_, [u8]>`
     |
help: the following other types implement trait `AsRef<T>`
    --> /Users/joelkunst/.rustup/toolchains/1.94.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/path.rs:3770:1
     |
3770 |   impl AsRef<Path> for Cow<'_, OsStr> {
     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::borrow::Cow<'_, OsStr>` implements `AsRef<Path>`
     |
    ::: /Users/joelkunst/.rustup/toolchains/1.94.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/borrow.rs:459:1
     |
 459 |   impl<T: ?Sized + ToOwned> AsRef<T> for Cow<'_, T>
     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::borrow::Cow<'_, T>` implements `AsRef<T>`
     |
    ::: /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/typed-path-0.12.2/src/common/non_utf8/path.rs:1058:1
     |
1058 | / impl<T> AsRef<Path<T>> for Cow<'_, [u8]>
1059 | | where
1060 | |     T: Encoding,
     | |________________^ `std::borrow::Cow<'_, [u8]>` implements `AsRef<typed_path::common::non_utf8::path::Path<T>>`
     |
    ::: /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/typed-path-0.12.2/src/common/utf8/path.rs:1070:1
     |
1070 | / impl<T> AsRef<Utf8Path<T>> for Cow<'_, str>
1071 | | where
1072 | |     T: Utf8Encoding,
     | |____________________^ `std::borrow::Cow<'_, str>` implements `AsRef<typed_path::common::utf8::path::Utf8Path<T>>`

   Compiling onig v6.5.1
   Compiling global-hotkey v0.7.0
   Compiling ts-rs v12.0.1
   Compiling arc-swap v1.8.2
error[E0282]: type annotations needed for `&_`
   --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extractors/fictionbook.rs:216:25
    |
216 |                     let trimmed = normalized.as_ref();
    |                         ^^^^^^^
217 |                     if !trimmed.is_empty() {
    |                         ------- type must be known at this point
    |
help: consider giving `trimmed` an explicit type, where the placeholders `_` are specified
    |
216 |                     let trimmed: &T = normalized.as_ref();
    |                                ++++

error[E0282]: type annotations needed for `&_`
   --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extractors/fictionbook.rs:311:25
    |
311 |                     let trimmed = normalized.as_ref();
    |                         ^^^^^^^
312 |                     if !trimmed.is_empty() {
    |                         ------- type must be known at this point
    |
help: consider giving `trimmed` an explicit type, where the placeholders `_` are specified
    |
311 |                     let trimmed: &T = normalized.as_ref();
    |                                ++++

error[E0282]: type annotations needed for `&_`
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extractors/fictionbook.rs:1059:25
     |
1059 |                     let trimmed = normalized.as_ref();
     |                         ^^^^^^^
1060 |                     if !trimmed.is_empty() {
     |                         ------- type must be known at this point
     |
help: consider giving `trimmed` an explicit type, where the placeholders `_` are specified
     |
1059 |                     let trimmed: &T = normalized.as_ref();
     |                                ++++

error[E0282]: type annotations needed for `&_`
    --> /Users/joelkunst/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/kreuzberg-4.6.3/src/extractors/fictionbook.rs:1434:25
     |
1434 |                     let trimmed = normalized.as_ref();
     |                         ^^^^^^^
1435 |                     if !trimmed.is_empty() {
     |                         ------- type must be known at this point
     |
help: consider giving `trimmed` an explicit type, where the placeholders `_` are specified
     |
1434 |                     let trimmed: &T = normalized.as_ref();
     |                                ++++

they build in crate A, but i use my crate A in project B, and project B does not build since 4.4.1

i looked at specific issue that was suposedly fixed before: #519 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions