Giter Club home page Giter Club logo

testcase-rustc-crate-version-mismatch's Introduction

This is another test case for rust-lang/rust#89143. This particular setup was reported by @johnm#2610 (@JtotheThree) on the Rust Discord server. This variant is hard to recognize because the help message contradicts with what the user has already done.

The problem was only recognized when attempting to using the fully qualified name failed.

error[E0277]: the trait bound `TestEnum: IntoEnumIterator` is not satisfied
 --> src/main.rs:7:14
  |
7 |     for x in <library::TestEnum as strum::IntoEnumIterator>::iter() {
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoEnumIterator` is not implemented for `TestEnum`

This error is also not directly helpful, but at least it does not give an unhelpful help message.

How to Run

Run the following

cd binary/
cargo +stable check
cargo +nightly check

The incorrect output follows. The version mismatch is not detected, and a seemingly incorrect help is given.

error[E0599]: no variant or associated item named `iter` found for enum `TestEnum` in the current scope
 --> src/main.rs:3:33
  |
3 |     for x in library::TestEnum::iter() {
  |                                 ^^^^ variant or associated item not found in `TestEnum`
  |
  = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
  |
1 | use strum::IntoEnumIterator;
  |

warning: unused import: `strum::IntoEnumIterator`
 --> src/main.rs:2:9
  |
2 |     use strum::IntoEnumIterator;
  |         ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

For more information about this error, try `rustc --explain E0599`.
warning: `binary` (bin "binary") generated 1 warning
error: could not compile `binary` due to previous error; 1 warning emitted

testcase-rustc-crate-version-mismatch's People

Contributors

konnorandrews avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.