Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upICE in ensure_public #29161
Comments
huonw
added
the
I-ICE
label
Oct 19, 2015
This comment has been minimized.
This comment has been minimized.
mod a {
struct A;
impl Default for A {
pub fn default() -> A {
A;
}
}
}
fn main() {
a::A::default();
} |
This comment has been minimized.
This comment has been minimized.
|
Works on current beta. Does not work on current nightly. |
alexcrichton
added
the
regression-from-stable-to-nightly
label
Oct 19, 2015
This comment has been minimized.
This comment has been minimized.
|
triage: P-high |
rust-highfive
added
the
P-high
label
Oct 27, 2015
nikomatsakis
added
the
T-compiler
label
Oct 27, 2015
nikomatsakis
self-assigned this
Oct 27, 2015
This comment has been minimized.
This comment has been minimized.
|
The unwrap seems to be from trying to get a def-id from a node-id that is not registered. |
This comment has been minimized.
This comment has been minimized.
|
Problem seems to be that the def-id is not local to the current crate. |
This comment has been minimized.
This comment has been minimized.
|
OK, the problem is that when doing the def-id conversion, I converted this code: .. if id == source_did.unwrap_or(to_check).node ..into this: let def_id = source_did.unwrap_or(to_check);
debug!("ensure_public: def_id = {:?}", def_id);
let node_id = self.tcx.map.as_local_node_id(def_id).unwrap();In particular, I used an unwrap when converting to a local node-id because the original code accessed the But I'm trying now to figure out what is SUPPOSED to happen here. I still don't quite understand the flow of this code. In particular I don't know what |
This comment has been minimized.
This comment has been minimized.
|
Probably the right fix is just to keep the let def_id = source_did.unwrap_or(to_check);
debug!("ensure_public: def_id = {:?}", def_id);
let node_id = self.tcx.map.as_local_node_id(def_id);
let (err_span, err_msg) = if Some(id) == node_id { |
nagisa commentedOct 19, 2015
Trying to make the test case now.