-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
size_of
of associated type ICEs
#43357
Comments
Hmm, the fact cc @arielb1 Was the layout code always going to ICE like that? Or did it get changed? Transmute checking uses it and that shouldn't ever ICE. |
The snippet below gives the right error, so likely I used the wrong way to get the layout. fn f<T: ::std::ops::Neg>(x: T) -> T::Output {
::std::mem::transmute(x)
} |
Duplicate of #43394? |
The problem is that rust/src/librustc_const_eval/eval.rs Line 345 in 5669c99
let layout_of = |ty: Ty<'tcx>| {
ty.layout(tcx, ty::ParamEnv::empty(traits::Reveal::All))
.map_err(|err| {
ConstEvalErr { span: e.span, kind: LayoutError(err) }
})
}; It should either use the "correct" param env (so that the types will still be WF) or it should bail out when it sees a generic type. |
Ah, I see, I'll try to plumb the |
+1 my rust cargo bench error using nightly build
|
rustc_const_eval: always require Substs and a ParamEnv. Fixes #43357 by tracking the `Substs` and `ParamEnv` for const-evaluation in generic contexts.
Originally reported in #43355, which should be a different bug from the main report.
On nightly, crashes with:
Does not crash with
1.20.0-beta.1 (e93aa3aa8 2017-07-18)
.cc @eddyb #42859, which is relevant and is inside the commit range e93aa3a...582af6e.
The text was updated successfully, but these errors were encountered: