Skip to content

Can't compile brotli with rustc 1.27.0-nightly (2f2a11dfc 2018-05-16) #50825

Closed
@nox

Description

@nox
error[E0277]: the trait bound `u64: core::slice::SliceIndex<[HistogramType]>` is not satisfied
   --> /Users/nox/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-1.1.2/src/enc/block_splitter.rs:271:26
    |
271 |   let data_size: usize = histograms[0].slice().len();
    |                          ^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |
    = help: the trait `core::slice::SliceIndex<[HistogramType]>` is not implemented for `u64`
    = note: required because of the requirements on the impl of `core::ops::Index<u64>` for `[HistogramType]`

error[E0277]: the trait bound `u64: core::slice::SliceIndex<[f32]>` is not satisfied
   --> /Users/nox/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-1.1.2/src/enc/block_splitter.rs:341:13
    |
341 |             (*cost_iter).0[sub_index] += local_insert_cost[sub_index];
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |
    = help: the trait `core::slice::SliceIndex<[f32]>` is not implemented for `u64`
    = note: required because of the requirements on the impl of `core::ops::Index<u64>` for `[f32]`

error[E0277]: the trait bound `u64: core::slice::SliceIndex<[f32]>` is not satisfied
   --> /Users/nox/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-1.1.2/src/enc/block_splitter.rs:341:42
    |
341 |             (*cost_iter).0[sub_index] += local_insert_cost[sub_index];
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |
    = help: the trait `core::slice::SliceIndex<[f32]>` is not implemented for `u64`
    = note: required because of the requirements on the impl of `core::ops::Index<u64>` for `[f32]`

error[E0277]: the trait bound `u64: core::slice::SliceIndex<[f32]>` is not satisfied
   --> /Users/nox/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-1.1.2/src/enc/block_splitter.rs:342:30
    |
342 |             let final_cost = (*cost_iter).0[sub_index];
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |
    = help: the trait `core::slice::SliceIndex<[f32]>` is not implemented for `u64`
    = note: required because of the requirements on the impl of `core::ops::Index<u64>` for `[f32]`

error[E0308]: mismatched types
   --> /Users/nox/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-1.1.2/src/enc/block_splitter.rs:345:45
    |
345 |               *block_id_ptr = (base_index + sub_index) as u8;
    |                                             ^^^^^^^^^ expected usize, found u64

error[E0277]: cannot add `u64` to `usize`
   --> /Users/nox/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-1.1.2/src/enc/block_splitter.rs:345:43
    |
345 |               *block_id_ptr = (base_index + sub_index) as u8;
    |                                           ^ no implementation for `usize + u64`
    |
    = help: the trait `core::ops::Add<u64>` is not implemented for `usize`

Cc @rust-lang/compiler

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions