Skip to content

1.98 regression: "expected std::ops::Range<usize>, found std::range::Range<usize>" #159431

Description

@theemathas

This regression was found by the 1.98 crater run

Error output
[INFO] [stdout] error[E0308]: mismatched types
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/nom-exif-2.2.1/src/exif.rs:90:8
[INFO] [stdout]    |
[INFO] [stdout] 90 |       Ok(exif_data
[INFO] [stdout]    |  _____--_^
[INFO] [stdout]    | |     |
[INFO] [stdout]    | |     arguments to this enum variant are incorrect
[INFO] [stdout] 91 | |         .and_then(|x| buf.subslice_range(x))
[INFO] [stdout] 92 | |         .map(|x| (x, header)))
[INFO] [stdout]    | |_____________________________^ expected `std::ops::Range<usize>`, found `std::range::Range<usize>`
[INFO] [stdout]    |
[INFO] [stdout]    = note: expected enum `Option<(std::ops::Range<usize>, Option<_>)>`
[INFO] [stdout]               found enum `Option<(std::range::Range<usize>, Option<_>)>`
[INFO] [stdout] help: the type constructed contains `Option<(std::range::Range<usize>, Option<TiffHeader>)>` due to the type of the argument passed
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/nom-exif-2.2.1/src/exif.rs:90:5
[INFO] [stdout]    |
[INFO] [stdout] 90 |        Ok(exif_data
[INFO] [stdout]    |   _____^  -
[INFO] [stdout]    |  |________|
[INFO] [stdout] 91 | ||         .and_then(|x| buf.subslice_range(x))
[INFO] [stdout] 92 | ||         .map(|x| (x, header)))
[INFO] [stdout]    | ||_____________________________-^
[INFO] [stdout]    | |______________________________|
[INFO] [stdout]    |                                this argument influences the type of `Ok`
[INFO] [stdout] note: tuple variant defined here
[INFO] [stdout]   --> /rustc/6b3fa26749ab40e159b2dd5cf577acaaf5902772/library/core/src/result.rs:561:4
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0308]: mismatched types
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/nom-exif-2.2.1/src/partial_vec.rs:43:24
[INFO] [stdout]    |
[INFO] [stdout] 43 |         Self::new(vec, range)
[INFO] [stdout]    |         ---------      ^^^^^ expected `std::ops::Range<usize>`, found `std::range::Range<usize>`
[INFO] [stdout]    |         |
[INFO] [stdout]    |         arguments to this function are incorrect
[INFO] [stdout]    |
[INFO] [stdout]    = note: expected struct `std::ops::Range<usize>`
[INFO] [stdout]               found struct `std::range::Range<usize>`
[INFO] [stdout] note: associated function defined here
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/nom-exif-2.2.1/src/partial_vec.rs:25:19
[INFO] [stdout]    |
[INFO] [stdout] 25 |     pub(crate) fn new(vec: Arc<Vec<u8>>, range: Range<usize>) -> PartialVec {
[INFO] [stdout]    |                   ^^^                    -------------------
[INFO] [stdout] help: call `Into::into` on this expression to convert `std::range::Range<usize>` into `std::ops::Range<usize>`
[INFO] [stdout]    |
[INFO] [stdout] 43 |         Self::new(vec, range.into())
[INFO] [stdout]    |                             +++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0308]: mismatched types
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/nom-exif-2.2.1/src/partial_vec.rs:57:49
[INFO] [stdout]    |
[INFO] [stdout] 57 |         AssociatedInput::new(self.data.clone(), range)
[INFO] [stdout]    |         --------------------                    ^^^^^ expected `std::ops::Range<usize>`, found `std::range::Range<usize>`
[INFO] [stdout]    |         |
[INFO] [stdout]    |         arguments to this function are incorrect
[INFO] [stdout]    |
[INFO] [stdout]    = note: expected struct `std::ops::Range<usize>`
[INFO] [stdout]               found struct `std::range::Range<usize>`
[INFO] [stdout] note: associated function defined here
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/nom-exif-2.2.1/src/partial_vec.rs:25:19
[INFO] [stdout]    |
[INFO] [stdout] 25 |     pub(crate) fn new(vec: Arc<Vec<u8>>, range: Range<usize>) -> PartialVec {
[INFO] [stdout]    |                   ^^^                    -------------------
[INFO] [stdout] help: call `Into::into` on this expression to convert `std::range::Range<usize>` into `std::ops::Range<usize>`
[INFO] [stdout]    |
[INFO] [stdout] 57 |         AssociatedInput::new(self.data.clone(), range.into())
[INFO] [stdout]    |                                                      +++++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] For more information about this error, try `rustc --explain E0308`.

Affects dependents of old versions of nom-exif:

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-api[DEPRECATED; DO NOT USE]regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions