We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ca70be commit d47dc32Copy full SHA for d47dc32
compiler/rustc_middle/src/ty/util.rs
@@ -876,7 +876,10 @@ impl<'tcx> TyCtxt<'tcx> {
876
// | Yes | No | No | !(true && !false) |
877
// | No | No | Yes | !(false && !false) |
878
!(self.is_private_dep(key)
879
- && !self.extern_crate(key.as_def_id()).expect("crate must exist").is_direct())
+ // If `extern_crate` is `None`, then the crate was injected (e.g., by the allocator).
880
+ // Treat that kind of crate as "indirect", since it's an implementation detail of
881
+ // the language.
882
+ && !self.extern_crate(key.as_def_id()).map_or(false, |e| e.is_direct()))
883
}
884
885
0 commit comments