Giter Site home page Giter Site logo

Comments (5)

creativcoder avatar creativcoder commented on May 20, 2024

I would like to work on this. Can you please elaborate more about this issue ?

from rust-clippy.

Manishearth avatar Manishearth commented on May 20, 2024

So here we need to check for situations where we are casting before comparing, i.e. x as u32 > 200 or x as u32 < 0, and the original type has a range such that the comparison will always be true or always be false.

...actually, this isn't really an easy bug since you have to look up the value of x and ensure its not getting written to.

from rust-clippy.

Manishearth avatar Manishearth commented on May 20, 2024

#97 should be easier. Its a simple check_ty with most of the details explained in the last comment. There are some complications there but I'll explain how to handle them when we reach that stage.

from rust-clippy.

llogiq avatar llogiq commented on May 20, 2024

I don't think so. It should suffice matching a comparison where one of the operands is an ExprCast whose inner expression has a primitive type that is smaller than the comapred value (via expr_ty)

from rust-clippy.

Manishearth avatar Manishearth commented on May 20, 2024

Ah, I misunderstood the issue. In that case this isn't too hard.

from rust-clippy.

Related Issues (20)

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.