-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
ICE librustc_mir/monomorphize/collector.rs:776:
Cannot create local mono-item for DefId
#60363
Comments
This panic did not occur when all code was combined into a single main.rs. It occurred as I moved code from main.rs into a new lib.rs, as it is in the attched .zip file. |
triage: P-high due to ICE; removing nomination tag. |
Update (pnkfelix): the reproduction posted on this comment (see below) no longer reproduces the bug with the currently nightly (perhaps due to a papering-over of the issue mentioned below). You can reproduce the issue with this test: // src/test/ui/issue-60363.rs
// aux-build:issue-60363.rs
extern crate issue_60363;
use issue_60363::Handler;
#[allow(dead_code)]
static HANDLER: Handler = Handler::new();
fn main() {} // src/test/ui/auxiliary/issue-60363.rs
#![crate_type = "rlib"]
#![feature(const_fn)]
use std::cell::UnsafeCell;
pub struct Handler {
h: UnsafeCell<*const dyn FnMut()>,
}
impl Handler {
pub const fn new() -> Self {
Self {
h: UnsafeCell::new(&Self::default_handler),
}
}
fn default_handler() {}
}
unsafe impl Sync for Handler {} See this comment for an explanation of the ICE. |
So... the We basically need to make sure that rust/src/librustc_mir/monomorphize/collector.rs Line 1193 in d65e721
AllocId from a different crate, because there can't possibly be any items in there that haven't already been collected upstream.
I'm not sure how we should solve that though :/ We could start giving |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Is this issue still occurring? rust/src/librustc_mir/monomorphize/collector.rs Line 1205 in a6b5d22
|
triage: Assigning to @oli-obk and self |
I am taking a break for a few months and I wont be able to look at this; unassigning self. |
@bjc can you confirm if this issue is still occurring for you? |
This just happened to me.
|
RLS is crashing on nightly 2019-09-22:
|
assigning back to self for initial investigation |
librustc_mir/monomorphize/collector.rs:776:
Cannot create local mono-item for DefId
The bug as encoded in the description of this bug appears to have been resolved sometime between nightly-2019-08-15 and nightly-2019-08-16:
|
My bet is that the issue, as encoded in the description of this bug, was deliberately fixed (with appropriate matching test case), in PR #63582 (which was marked as fixing #63226) and was part of rollup PR #63592. Closing as fixed. (The other comments that mention similar problems should be filed as independent bugs, hopefully with more information such as links to source crates that replicate the issue, to allow us to actually investigate them.) |
I'm still getting an identical stack trace on my code on nightly-2019-11-06. My guess is it's perhaps inlining or some other heuristics that have been tweaked, masking the ICE of the original report.
|
I already have done everything I can with the source code attached to this bug. Seeing analgous stack traces does not provide me with an alternative piece of source code to test and explore. as previously noted in my closing comment:
|
This reverts commit 1508074.
This reverts commit 1508074.
Rust nightly: % rustc --version
rustc 1.36.0-nightly (6d59933 2019-04-22)
Test code attached: intfn6.zip
The text was updated successfully, but these errors were encountered: