-
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
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. |
n = cx.tcx.const_eval(param_env.and((def_id, substs))).unwrap() | ||
if let Ok(new_n) = cx.tcx.const_eval(param_env.and((def_id, substs))) { | ||
n = new_n; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean instead of const_eval
? Otherwise, this new assignement to n
will never be used...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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