Giter VIP home page Giter VIP logo

Comments (6)

lqd avatar lqd commented on July 26, 2024 1

Amanda (and I, when I have a bit more time) will also look into this soon-ish to try and see where NLLs differ from the location-insensitive pass in this new situation.

from rust.

amandasystems avatar amandasystems commented on July 26, 2024 1

The problem is that NLL has an optimisation for computing loans out of scope that shortens the scope to skip the two final reborrows in the generated MIR body because borrowed_place.ignore_borrow() returns true, but Polonius doesn't so the scope for NLL is slightly shorter while the Polonius kill happens at the start of the cleanup/return blocks.

from rust.

matthiaskrgr avatar matthiaskrgr commented on July 26, 2024

Regression in nightly-2024-06-05
#125667 🤔 cc @oli-obk

from rust.

amandasystems avatar amandasystems commented on July 26, 2024

I can narrow that down to specifically:

outlives_constraints = Default::default();

Looking into a work-around!

from rust.

amandasystems avatar amandasystems commented on July 26, 2024

This only happens when the "remove constraints" trick of @oli-obk's is engaged because liveness values are merged into SCCs during construction of RegionInferenceContext, which happens after the constraints have been removed. This means that region liveness in Polonius still has the old view of the constraint graph via BorrowSet while NLL considers the rewritten graph.

Ironically this means that NLL is now slightly context-sensitive in the sense that parts of the constraint graph disappears between MIR statements.

from rust.

amandasystems avatar amandasystems commented on July 26, 2024

I don't think I can safely convert the work-around to Polonius since I'd have to either move the liveness logic to a later stage of computation (design change) or undo parts of the computation of the BorrowSet to exclude certain variables as holders of loans (scary, above my current power level).

from rust.

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.