Fix const evaluation ICE in rustdoc#47862
Conversation
|
@bors r+ |
|
📌 Commit c786dca has been approved by |
|
The same issue exists when cross crate inlining: rust/src/librustdoc/clean/mod.rs Line 2580 in 90eb44a |
|
@ollie27 Oh, right. That would have to show |
|
Would changing that line to this not work? if let Ok(new_n) = cx.tcx.const_eval(param_env.and((def_id, substs))) {
n = new_n;
} |
|
Oh oops sorry you're right! @bors r- |
c786dca to
a0cbb7f
Compare
|
Updated. |
src/librustdoc/clean/mod.rs
Outdated
There was a problem hiding this comment.
Can you use the same trick in the other function? You just have to do this first, before const_eval:
let n = tcx.mk_const(ty::Const {
val: ConstVal::Unevaluated(def_id, substs),
ty: tcx.types.usize
});There was a problem hiding this comment.
Do you mean instead of const_eval? Otherwise, this new assignement to n will never be used...
There was a problem hiding this comment.
I mean it'd be this in the other place (line 2450) - rewrote it a bit since previous comment:
let n = cx.tcx.const_eval(param_env.and((def_id, substs))).unwrap_or_else(|_| {
cx.tcx.mk_const(ty::Const {
val: ConstVal::Unevaluated(def_id, substs),
ty: cx.tcx.types.usize
})
});a0cbb7f to
6b35d81
Compare
|
Updated. |
|
@bors r+ |
|
📌 Commit 6b35d81 has been approved by |
…, r=eddyb Fix const evaluation ICE in rustdoc Fixes rust-lang#47860. r? @eddyb
|
⌛ Testing commit 6b35d81 with merge edecd1a5251488e5b7001ad0eee516738f648149... |
|
💔 Test failed - status-appveyor |
…, r=eddyb Fix const evaluation ICE in rustdoc Fixes rust-lang#47860. r? @eddyb
…, r=eddyb Fix const evaluation ICE in rustdoc Fixes rust-lang#47860. r? @eddyb
|
💥 Test timed out |
|
@bors clean r- retry (This PR was stuck in the queue as "failure" state.) |
Fixes #47860.
r? @eddyb