Function rustc::ty::item_path::characteristic_def_id_of_type[][src]

pub fn characteristic_def_id_of_type(ty: Ty) -> Option<DefId>
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

As a heuristic, when we see an impl, if we see that the 'self-type' is a type defined in the same module as the impl, we can omit including the path to the impl itself. This function tries to find a "characteristic def-id" for a type. It's just a heuristic so it makes some questionable decisions and we may want to adjust it later.