Comments (8)
This should be fixed on nightly, awaiting a beta backport
from rust.
@Nilstrieb I'm going from #126889 (comment)
from rust.
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.
Bisects to #125958, cc PR author @BoxyUwU -- ah but it's likely a duplicate of #126378 and so forth.
from rust.
this is stable and doesn't use effects, so it's probably different
from rust.
I cannot reproduce this locally
edit: oh --release
is required
from rust.
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.
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)
- compiletest: add a `needs-subprocess` directive HOT 2
- Add back io::copy file to pipe optimization HOT 13
- The suggestion to remove generic parameters proposed by help did not remove comma HOT 5
- Unhelpful error message "Attempt to negate with overflow" when calling `i64::abs(i64::MIN)`.
- borrow diagnostic of dbg! leaks implementation HOT 1
- `#[diagnostic]` attribute name space is experimental HOT 2
- DefId(...) does not have a "params_in_repr" HOT 1
- `./x test <path_to_test>` does not work on msys2 HOT 1
- Rust version dev produced for vxworks build HOT 2
- `const { ... }` blocks cannot be written outside of function HOT 4
- Hard-to-read ICEs when fluent translation uses non-existing variable HOT 5
- ICE: transcribe: `None`
- rustdoc converts byte literal discriminants into decimal numbers HOT 1
- Compiler builtins missing f16/f128 symbols HOT 5
- Repr is incorrectly documented for structs with hidden field HOT 1
- rustc uses a constantly increasing amount of memory up to OS crash or OOM kill HOT 5
- Rust ; {} and indent HOT 6
- Suggest `ptr::null` when using `ptr::addr_of!(0)` or `&raw const 0` HOT 2
- Incorrect field offset when using #[repr(C, packed(8))] HOT 4
- Mutating through `Option::inspect` gives bogus suggestion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.