Giter VIP home page Giter VIP logo

Comments (8)

compiler-errors avatar compiler-errors commented on August 16, 2024 2

This should be fixed on nightly, awaiting a beta backport

from rust.

lqd avatar lqd commented on August 16, 2024 1

@Nilstrieb I'm going from #126889 (comment)

from rust.

BoxyUwU avatar BoxyUwU commented on August 16, 2024 1

Assigning @compiler-errors since he said he'd take a look at this after I figured out that this is a mess to fix.

The tl;dr here is that pre-monomorphization we wind up trying to instance drop glue.

The logic for creating drop glue should be able to assume that it is in a post-monomorphization state where using an empty ParamEnv is fine. Because we try to instance drop glue with generic types (e.g. Foo<N>) this means that we need to actually be using the ParamEnv of the body that is instancing the drop glue instead. This turns out to be quite involved to fix and not as simple as other "pass the correct param env in" bug fixes.

The... good ish? bad? news ? is that we've been getting this wrong for much longer than my PR, my PR only surfaced this due to the fact that it relies on us providing the correct ParamEnv everywhere in the compiler which apparently is not the case :-)

edit: I suspect the principled solution here is to have two codepaths (that share logic) for generating mir shims. One for instancing stuff post mono that behaves how monomorphization should be behaving and can use an empty Reveal::All env. And one for when we want to generate the mir pre-mono and it's as if we're putting the mir inline into some other body in which cases we need to be using the ParamEnv of the body we're placing the shim's mir into`.

from rust.

lqd avatar lqd commented on August 16, 2024

Bisects to #125958, cc PR author @BoxyUwU -- ah but it's likely a duplicate of #126378 and so forth.

from rust.

Noratrieb avatar Noratrieb commented on August 16, 2024

this is stable and doesn't use effects, so it's probably different

from rust.

BoxyUwU avatar BoxyUwU commented on August 16, 2024

I cannot reproduce this locally

edit: oh --release is required

from rust.

BoxyUwU avatar BoxyUwU commented on August 16, 2024

To avoid breaking stuff when beta gets bumped to stable we probably want to try the following:

  • Figure out exactly what's causing the drop glue generation to occur in --release and see if its viable to backport a change to stop doing that to mask the bug for a cycle
  • If thats not possible try to revert Const::ty removal on beta only
  • If that's not possible try land a hack that's simple to reason about and beta backport it

And then when that's done try to land the principled refactoring before the next beta cutoff

from rust.

compiler-errors avatar compiler-errors commented on August 16, 2024

This has been beta-backported, should show up next time a beta build is released on rustup (next day or so?)

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.